【问题标题】:Neo4Django - KeyError: 'GremlinPlugin' error while creating an objectNeo4Django - KeyError:创建对象时出现“GremlinPlugin”错误
【发布时间】:2014-08-24 16:11:12
【问题描述】:

我正在努力学习在我的 django 项目中使用 Neo4jdatabase。我从github 存储库安装了Neo4Django。当我尝试从我的模型创建一个新对象时,遵循它的neo4j tutorial,我遇到了这个错误:

KeyError: 'GremlinPlugin'

我正在使用Python 2.7Django Version 1.5.8Pycharm 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'

【问题讨论】:

    标签: django python-2.7 neo4j neo4django


    【解决方案1】:

    似乎 Neo4j Django 驱动程序依赖于 Neo4j 服务器上的 Gremlin 插件。从 Neo4j 2.0 开始,Gremlin 已从发行版中删除,但仍以 contribution package 的形式提供,请参阅那里的说明。

    【讨论】:

    • 我安装了windows 发行版。所以我需要从源代码编译neo4j?
    • 不,你只需要下载 contrib 包,构建它并按照文档进行安装。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-11-20
    • 1970-01-01
    • 2016-01-07
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多