我正在尝试学习在我的django项目中使用Neo4j
数据库。我从Neo4Django
存储库安装了github
。当我尝试从我的模型中创建一个新对象时,我跟着它neo4j tutorial,我遇到了这个错误:
KeyError:'GremlinPlugin'
我正在使用Python 2.7
,Django Version 1.5.8
,Pycharm 3
我的模特是:
class Movie(models.NodeModel):
# name of the movie
title = models.StringProperty()
我创建对象的控制台代码是:
from nodes_app.models import Movie
movie = Movie.objects.create(title='a')
这是错误的控制台输出:
Traceback (most recent call last):
File "<input>", line 1, in <module>
File "C:\Python27\lib\site-packages\neo4django-0.1.8-py2.7.egg\neo4django\db\models\manager.py", line 43, in create
return self.get_query_set().create(**kwargs)
File "C:\Python27\lib\site-packages\neo4django-0.1.8-py2.7.egg\neo4django\db\models\query.py", line 1307, in create
return super(NodeQuerySet, self).create(**kwargs)
File "C:\Python27\lib\site-packages\django-1.5.8-py2.7.egg\django\db\models\query.py", line 416, in create
obj.save(force_insert=True, using=self.db)
File "C:\Python27\lib\site-packages\neo4django-0.1.8-py2.7.egg\neo4django\db\models\base.py", line 325, in save
return super(NodeModel, self).save(using=using, **kwargs)
File "C:\Python27\lib\site-packages\django-1.5.8-py2.7.egg\django\db\models\base.py", line 546, in save
force_update=force_update, update_fields=update_fields)
File "C:\Python27\lib\site-packages\neo4django-0.1.8-py2.7.egg\neo4django\db\models\base.py", line 341, in save_base
self._save_neo4j_node(using)
File "<string>", line 2, in _save_neo4j_node
File "C:\Python27\lib\site-packages\neo4django-0.1.8-py2.7.egg\neo4django\db\models\base.py", line 98, in trans_method
ret = func(*args, **kw)
File "C:\Python27\lib\site-packages\neo4django-0.1.8-py2.7.egg\neo4django\db\models\base.py", line 369, in _save_neo4j_node
typesToIndex=type_names_to_index)
File "C:\Python27\lib\site-packages\neo4django-0.1.8-py2.7.egg\neo4django\neo4jclient.py", line 179, in gremlin_tx
return self.gremlin(script, tx=True, **params)
File "C:\Python27\lib\site-packages\neo4django-0.1.8-py2.7.egg\neo4django\neo4jclient.py", line 127, in gremlin
ext = self.extensions.GremlinPlugin
File "C:\Python27\lib\site-packages\neo4jrestclient\client.py", line 2176, in __getattr__
self._dict[attr] = ExtensionModule(self._extensions[attr], self._auth)
KeyError: 'GremlinPlugin'
答案 0 :(得分:1)
似乎Neo4j Django驱动程序依赖于Neo4j服务器上的Gremlin
插件。从Neo4j 2.0开始,Gremlin已从发行版中删除,但仍以contribution package形式提供,请参阅其中的说明。