I am a new user of python and the neo4j. I just want to run the python file in Pycharm and connect to Neo4j. But the import of py2neo always does not work, I tried to use Virtualenv but still does not work. I have tried to put my py file inside env folder or outside and both don't work.
I really install the py2neo and the version is the latest, how to solve this problem???
My code:
from py2neo import Graph, Node, Relationship
graph = Graph("http://localhost:7474")
jack = Node("Perosn", name="Jack")
nicole = Node("Person",name="Nicole")
tina = Node("Person", name="Tina")
graph.create(Relationship(nicole, "KNOWS",jack))
graph.create(Relationship(nicole, "KNOWS",tina))
graph.create(Relationship(tina, "KNOWS",jack))
graph.create(Relationship(jack, "KNOWS",tina))
Error:
Traceback (most recent call last):
File "/Users/huangjingzhan/PycharmProjects/untitled2/venv/neo4j.py", line 1, in <module>
from py2neo import Graph, Node, Relationship
ModuleNotFoundError: No module named 'py2neo'
check which python version is configured to run the project and make sure that module is installed for that version.
here is how to: Pycharm