0

我正在尝试在 python 2.7 中设置 neo4j,但遇到了一个令人震惊的错误。我对 neo4j 和 python 以及 Ubuntu 还很陌生,非常感谢一些帮助

这是我得到的错误

>>> import neo4j

Traceback (most recent call last):
  File "<pyshell#0>", line 1, in <module>
    import neo4j
  File "/usr/local/lib/python2.7/dist-packages/neo4j/__init__.py", line 29, in <module>
    from neo4j.core import GraphDatabase, Direction, NotFoundException, BOTH, ANY, INCOMING, OUTGOING
  File "/usr/local/lib/python2.7/dist-packages/neo4j/core.py", line 19, in <module>
    from _backend import *
  File "/usr/local/lib/python2.7/dist-packages/neo4j/_backend.py", line 135, in <module>
    raise Exception("Unable to start JVM, even though I found the JVM path. If you are using windows, this may be due to missing system DLL files, please see the windows installation instructions in the neo4j documentation.",e)
Exception: ('Unable to start JVM, even though I found the JVM path. If you are using windows, this may be due to missing system DLL files, please see the windows installation instructions in the neo4j documentation.', TypeError("unsupported operand type(s) for +: 'NoneType' and 'str'",))

我已经安装了 Java 6 Oracle 以及 jpype,正如我在使用 ubuntu 12.10 之前所说的那样?我应该设置JAVA_HOME吗?如果可以,如何设置,如果不是,有人可以提出什么其他建议?

4

1 回答 1

2

看起来 JPype 找不到您的 Java 运行时。您可以使用以下命令找出运行 Java 的位置:

readlink -e `which java`

这应该给你类似的东西:

/usr/lib/jvm/java-7-openjdk-amd64/jre/bin/java

然后,您可以使用此路径来设置 JAVA_HOME 环境变量:

export JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64/jre

希望这可以帮助

尼日

于 2012-12-11T16:11:23.327 回答