2

Could someone please advise in resolving the below error? Python 3.5.1 / jpype1-py3 0.5.5.2 installed on 64 bit windows machine. I've cannot find _jtype anywhere in Lib or Lib/site-packages.

Regards Steve

>>> import jpype
Traceback (most recent call last):
  File "", line 1, in 
    import jpype
  File "C:\Program Files\Python35\lib\site-packages\jpype\__init__.py", line 18, in 
    from ._jpackage import *
  File "C:\Program Files\Python35\lib\site-packages\jpype\_jpackage.py", line 18, in 
    import _jpype
ImportError: DLL load failed: The specified module could not be found.
swsupp
  • 21
  • 1
  • 2

1 Answers1

1

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

Tales Pádua
  • 1,331
  • 1
  • 16
  • 36
  • It looks like this is the problem. I've got as far as compiling now - Its trying to build _jpype but I don't have a C++ compiler installed (yet). – swsupp Mar 16 '16 at 19:52
  • Nice! Glad for helping. Look for MinGW for C/C++ compilers – Tales Pádua Mar 16 '16 at 20:00
  • The JAVA_HOME setting link is broken in the answer. You can set JAVA_HOME on Windows as "set JAVA_HOME=C:\my\path\with spaces\to\jdk". You should also do "set PATH=%PATH%;%JAVA_HOME%\bin" if not done already by the installer. On *nix "export JAVA_HOME=/my/path/to/java" and "export PATH=${PATH}:${JAVA_HOME}/bin" – Amit Tendulkar Aug 11 '22 at 07:00