gpt4 book ai didi

java - python neo4j jvm错误

转载 作者:行者123 更新时间:2023-12-02 07:23:44 24 4
gpt4 key购买 nike

我正在尝试在 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 吗?如果是,如何设置,如果不是,有人可以提出什么其他建议?

最佳答案

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


readlink -e `哪个java`

这应该给你类似的东西:


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

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


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

希望这有帮助

尼格

关于java - python neo4j jvm错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13823234/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com