Coder Social home page Coder Social logo

Comments (4)

keenborder786 avatar keenborder786 commented on August 14, 2024

Please update to latest version of langchain_community, because I used python version 3.12.4 and faced no error when executing the below code:

from langchain_community.graphs import Neo4jGraph

graph = Neo4jGraph()

# Import movie information

movies_query = """
LOAD CSV WITH HEADERS FROM 
'https://raw.githubusercontent.com/tomasonjo/blog-datasets/main/movies/movies_small.csv'
AS row
MERGE (m:Movie {id:row.movieId})
SET m.released = date(row.released),
    m.title = row.title,
    m.imdbRating = toFloat(row.imdbRating)
FOREACH (director in split(row.director, '|') | 
    MERGE (p:Person {name:trim(director)})
    MERGE (p)-[:DIRECTED]->(m))
FOREACH (actor in split(row.actors, '|') | 
    MERGE (p:Person {name:trim(actor)})
    MERGE (p)-[:ACTED_IN]->(m))
FOREACH (genre in split(row.genres, '|') | 
    MERGE (g:Genre {name:trim(genre)})
    MERGE (m)-[:IN_GENRE]->(g))
"""

graph.query(movies_query)

from langchain.

tamilselvanav avatar tamilselvanav commented on August 14, 2024

Thanks for the response @keenborder786 .
But I still face the same issue. I use langchain_community v0.2.4 (which is the latest as of now).

Here are some more details that might help.
Python v3.12.4 (I used the one from Microsoft Store and later with the one downloaded from https://www.python.org/downloads/release/python-3124/. I hope this shouldn't make a difference. But sharing here as I tried both)
OS: Windows 10
IDE: Visual Studio Code
Virtual environment: venv

The requirements.txt file I use has the following content:
python-dotenv==1.0.1
langchain==0.2.3
langchain-community==0.2.4
langchain-openai==0.1.8
neo4j==5.20.0

Important note: Everything works fine if I use Python v3.11.7 instead of Python v3.12.4.

from langchain.

keenborder786 avatar keenborder786 commented on August 14, 2024

@tamilselvanav can you try python 3.12.3

from langchain.

tamilselvanav avatar tamilselvanav commented on August 14, 2024

@keenborder786 : Yes, I tried and the same code works fine with Python v3.12.3

from langchain.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.