无法将python与titan db连接起来

时间:2018-04-12 10:30:19

标签: titan tinkerpop3 gremlin-server

按照配置titan srever的步骤

bin/titan.sh

Forking Cassandra...
Running `nodetool statusthrift`... OK (returned exit status 0 and printed string "running").
Forking Elasticsearch...
Connecting to Elasticsearch (127.0.0.1:9300)... OK (connected to 127.0.0.1:9300).
Forking Gremlin-Server...
Connecting to Gremlin-Server (127.0.0.1:8182)... OK (connected to 127.0.0.1:8182).
Run gremlin.sh to connect.

服务器启动完美,但是当我连接python然后运行脚本时我在下面提到的错误

Traceback (most recent call last):
  File "/home/admin-12/Documents/bitbucket/ecodrone/ecodrone/GremlinConnector.py", line 28, in <module>
    data = (execute_query("""g.V()"""))
  File "/home/admin-12/Documents/bitbucket/ecodrone/ecodrone/GremlinConnector.py", line 22, in execute_query
    results = future_results.result()
  File "/usr/lib/python3.6/concurrent/futures/_base.py", line 432, in result
    return self.__get_result()
  File "/usr/lib/python3.6/concurrent/futures/_base.py", line 384, in __get_result
    raise self._exception
  File "/home/admin-12/.local/lib/python3.6/site-packages/gremlin_python/driver/resultset.py", line 81, in cb
    f.result()
  File "/usr/lib/python3.6/concurrent/futures/_base.py", line 425, in result
    return self.__get_result()
  File "/usr/lib/python3.6/concurrent/futures/_base.py", line 384, in __get_result
    raise self._exception
  File "/usr/lib/python3.6/concurrent/futures/thread.py", line 56, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/home/admin-12/.local/lib/python3.6/site-packages/gremlin_python/driver/connection.py", line 77, in _receive
    self._protocol.data_received(data, self._results)
  File "/home/admin-12/.local/lib/python3.6/site-packages/gremlin_python/driver/protocol.py", line 71, in data_received
    result_set = results_dict[request_id]
KeyError: None

我正在使用的版本 泰坦 - 1.0.0
gremlin-python - 3.3.2
apache-tinkerpop-gremlin-server-3.3.1

1 个答案:

答案 0 :(得分:2)

Titan支持一些非常古老的TinkerPop版本,如果你尝试使用gremlin-python 3.3.2,我相信你会发现一些不兼容的东西。由于不再支持Titan,我建议您升级到JanusGraph,这是Titan的更新版本和维护版本。