Different Neptune versions support different gremlin_python versions, and different gremlin_python versions may require workarounds for Python asyncio / Jupyter's builtin Tornado client.
As needed, use the below workarounds. If installing packages, remember to restart your Python kernel (kernel
-> restart
) before continuing
Graphistry maintains versions that should work for latest known in both its main distributions, GPU base Docker containers, and graph-app-kit Streamlit dashboarding containers
Version matching: https://docs.aws.amazon.com/neptune/latest/userguide/access-graph-gremlin-client.html
Inspect your versions:
! pip show gremlinpython tornado graphistry | grep 'Name\|Version'
Switch:
! pip install --user gremlinpython==3.4.10
gremlinpython (versions < 3.5.0) gets confused by multiple event loops such as jupyter's use of tornado. This is supposed to be better in gremlinpython 3.5.0+ which switches to asyncio, but at the time of writing, Neptune does not officially support it.
Approaches:
Downgrade tornado and gremlin
! pip install --user tornado==4.5.3
enable loop nesting
import nest_asyncio
nest_asyncio.apply()
start a new loop
import asyncio
loop = asyncio.new_event_loop()
asyncio.set_event_loop(loop)