Skip to main content
 首页 » 编程设计

python之在 Python 中从 bulbs.neo4jserver 导入图形时出错

2025年05月04日11zlslch

我正在尝试使用 gremlin 运行 neo4j。我正在关注灯泡文档中的第一个示例,尝试导入 bulbs.neo4jserver .Graph。我可以导入灯泡,它看到 gremlin,但无法使用以下命令导入图形。

>>> import bulbs 
>>> bulbs.gremlin 
<module 'bulbs.gremlin' from 'C:\Anaconda\lib\site-packages\bulbs\gremlin.pyc'> 
>>> from bulbs.neo4jserver import Graph 
Traceback (most recent call last): 
  File "<interactive input>", line 1, in <module> 
ImportError: cannot import name Graph 

我已经在 gremlin 和 rexster 上下载并运行了 maven。我在 Windows 8 中使用 Python 2.7(Anaconda 安装)工作。

您还需要了解什么?

感谢任何帮助。谢谢。

请您参考如下方法:

您使用的是哪个版本的 Bulbs?

$ pip freeze | grep bulbs 

你应该能够做到这一点......

$ python 
Python 2.7.5 (default, Feb 19 2014, 13:47:28)  
Type "help", "copyright", "credits" or "license" for more information. 
>>>  
>>> from bulbs.neo4jserver import Graph 
>>> g = Graph()