Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
03-17-2020 09:58 PM
I am trying to write code in Python (MacOS, Python 3.7.6 64-bit, Spyder 4.0.1) but I can't even get the HelloWorld example to work from the "Using Neo4j from Python" section of the Developer Guide. It fails at the first line. "pip list" shows I have the neo4j Python driver 1.7.6. I am running Neo4j Desktop 1.2.4 with Neo4j Browser 4.0.3 (all freshly installed). I have a single empty graph, visible in Neo4j Browser 4.0.3, which indicates I am running Neo4j 4.0.1.
I have read the previous topic on this error message and none of the answers make sense to me / don't work for me that I can see.
Perhaps I have to wait for "the upcoming 2.0 release of the driver"?
Any clues?
from neo4j import GraphDatabase # <--- fails here
class HelloWorldExample(object):
def __init__(self, uri, user, password):
self._driver = GraphDatabase.driver(uri, auth=(user, password))
def close(self):
self._driver.close()
def print_greeting(self, message):
with self._driver.session() as session:
greeting = session.write_transaction(self._create_and_return_greeting, message)
print(greeting)
@staticmethod
def _create_and_return_greeting(tx, message):
result = tx.run("CREATE (a:Greeting) "
"SET a.message = $message "
"RETURN a.message + ', from node ' + id(a)", message=message)
return result.single()[0]
03-18-2020 07:32 AM
Welcome to the community John. Do you have your error messages? Or logs? That might help us get you pointed in the right direction. Thank you.
03-18-2020 01:29 PM
Do you have both neo and neobolt packages installed?
Here's my list
neo4j 1.7.3
neobolt 1.7.13
I don't have any issues in connecting to Neo4j server.
03-18-2020 04:25 PM
Thanks, I have:
neo4j 1.7.6
neo bolt 1.7.15
Error message in the Spyder console:
Traceback (most recent call last):
File "/Users/johnburton/Documents/Python Workspace/pythondriver1.py", line 9, in
from neo4j import GraphDatabase
ModuleNotFoundError: No module named 'neo4j'
03-18-2020 04:27 PM
Oops, that should be 'neo bolt 1.7.15'
Lines 1-8 are blank or commented.
03-18-2020 04:28 PM
autocorrect!, 'neobolt'
All the sessions of the conference are now available online