Goofy Gert Goofy Gert - 4 years ago 152
Python Question

Trust On First Use in BOLT Neo4j driver for python - how to make the code run

I'm using PyCharm 2016.1.4 and an example from the neo4j manual. I'm wondering how to use the TRUST_ON_FIRST_USE in the expression. It's not recognized by pycharm as a valid entry. Placing it between " " or ' ' also did not resolve the issue. What do I miss here?

driver = GraphDatabase.driver("bolt://localhost", auth=basic_auth("neo4j", "password"), encrypted=True, trust=TRUST_ON_FIRST_USE)

With " " or ' ': TypeError: unorderable types: str() >= int()
Without " " or ' ' : NameError: name 'TRUST_ON_FIRST_USE' is not defined

Answer Source

You presumably need to include:

from neo4j.v1 import TRUST_ON_FIRST_USE
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download