I've got a rather large graph in Neo4j and need to do some computational stuff with it. This is why I need to do it on a HPC cluster. So far so good. But my programm accesses the neo4j graph several times which I can not do on the cluster. This is why I wanted to dump the graph object with pickle.dump(). Unfortunately I get an error:
File "...myFile.py", line 9, in pickle.dump(Graph("bolt:///localhost:7474/", auth=("neo4j", "0000")), f) AttributeError: Can't pickle local object 'ConnectionPool.connect..'
My (simplified) code:
import pickle
from py2neo import Graph
graph2 = Graph("bolt:///localhost:7474/", auth=("neo4j", "0000"))
with open('graph.pkl', 'wb') as f:
pickle.dump(Graph("bolt:///localhost:7474/", auth=("neo4j", "0000")), f)
with open('graph.pkl', 'rb') as f:
graph = pickle.load(f)
print("Hello")
Can someone tell me, why I get this error (and possibly how to get rid of it)? Thank you very much in advance.