1

有人可以建议解决以下错误吗?Python 3.5.1 / jpype1-py3 0.5.5.2 安装在 64 位 Windows 机器上。我在 Lib 或 Lib/site-packages 的任何地方都找不到 _jtype。

问候史蒂夫

>>> 导入 jpype
回溯(最近一次通话最后):
  文件“”,第 1 行,在
    导入 jpype
  文件“C:\Program Files\Python35\lib\site-packages\jpype\__init__.py”,第 18 行,在
    从 ._jpackage 导入 *
  文件“C:\Program Files\Python35\lib\site-packages\jpype\_jpackage.py”,第 18 行,在
    导入_jpype
ImportError:DLL 加载失败:找不到指定的模块。
4

1 回答 1

0

According to this thread, you need to make sure setup.py is pointing to the correct jvm directory. looking into setup.py of you can see that it searches for JAVA_HOME system variable:

java_home = os.getenv('JAVA_HOME', '')
found_jni = False
if os.path.exists(java_home):
    platform_specific['include_dirs'] += [os.path.join(java_home, 'include')]
# The code goes on

It may be that you didn't configure this system variable.

Since you installed via pip, and probalby didn't touch te setup.py file, I recommend you to do the following:
1-) Uninstall the package, and delete the build directories
2-) Set JAVA_HOME variable following this
3-) Download JPype manually from github and install it using python setup.py install

Good luck, tell me if it works

于 2016-03-16T18:16:23.063 回答