Kappa-Dev / ReGraph

Tool for building graph-based hierarchical knowledge representation systems
http://dev.executableknowledge.org/ReGraph/
MIT License
73 stars 16 forks source link

Not compatible with latest version of Neo4j driver #10

Closed benbc closed 2 years ago

benbc commented 2 years ago

There has been a backwards incompatible change to the Neo4j drivers which changed the package structure. As a result, installing and then importing regraph fails.

>>> import regraph
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/benbc/src/opensafely-core/databuilder/.venv/lib/python3.9/site-packages/regraph/__init__.py", line 6, in <module>
    from regraph.backends.neo4j.graphs import Neo4jGraph
  File "/home/benbc/src/opensafely-core/databuilder/.venv/lib/python3.9/site-packages/regraph/backends/neo4j/__init__.py", line 3, in <module>
    from regraph.backends.neo4j.graphs import Neo4jGraph
  File "/home/benbc/src/opensafely-core/databuilder/.venv/lib/python3.9/site-packages/regraph/backends/neo4j/graphs.py", line 10, in <module>
    from neo4j.v1 import GraphDatabase
ModuleNotFoundError: No module named 'neo4j.v1'

The fix needed is to pin the neo4j-driver dependency in setup.py to < 4.0.0.

As a workaround you can provide this dependency yourself alongside the dependency on regraph so that the latest version of neo4j-driver doesn't get installed.

(This project doesn't look like it's maintained, so I'm mostly putting this here as documentation so that other people can find the workaround.)

benbc commented 2 years ago

I discovered that this only applies to the latest published version on PyPI. The latest code in this repo is working fine, so installing directly from here is an even better workaround. Since there haven't been any releases in over two years, I imagine that anyone who is still using this library is installing from here already; so I'll close this issue.

Just in case the library authors see this: it's a really helpful addition to NetworkX -- thanks!