문제

When I want to import jnius there is an error like:

Traceback (most recent call last):
...
File "C:\Python27\lib\site-packages\jnius\__init__.py", line 12, in <module>
    from .jnius import *
ImportError: DLL load failed: The specified module could not be found.

I need jnius in order to use: https://github.com/kevlened/sikuli_cpython

What I have and use:

  • Windows 7 Enterprise x64
  • Python 2.7.6 x86
  • Cython-0.19.2
  • jnius-1.1-dev
  • JDK 7 Update 45 x86
도움이 되었습니까?

해결책

Add the following to your Path environment variable (under "system variable"):

C:\Program Files (x86)\Java\jdk[YOUR JDK VERSION]\jre\bin\server

-or-

C:\Program Files (x86)\Java\jre[YOUR JDK VERSION]\bin\client

This was pointed out here, and it also points out you should set the JAVA_HOME "user variable":

C:\Program Files (x86)\Java\jdk[YOUR JDK VERSION]

Since jnius is a java wrapper, the "DLL" that fails to load may often be the "jvm.dll" located in that "server" folder.

Then again, there could be other DLL files missing. Ensure you have msvcr90 or msvcr100 and others provided by installing visual studio 2008 or 2010 redistributable. A more complete answer to your question can be found by downloading dependency walker and analyzing the required DLLs for jnius.pyd (I think I remember from personal experience it does require msvcr100 and msvcr90).

다른 팁

For Adopt OpenJDK use C:\Program Files\AdoptOpenJDK\jdk-8.0.212.04-hotspot\jre\bin\server

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top