2

I tried to install jnius Python module by typing 'pip install jnius' in CMD. This is the message I got:

Complete output from command python setup.py egg_info:
Traceback (most recent call last):
 File "<string>", line 1, in <module>
 File "c:\users\sm\appdata\local\temp\pip-install-vu2sb5\jnius\setup.py", line 111, in <module>
    raise Exception('Unable to determine JDK_HOME')
Exception: Unable to determine JDK_HOME
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in 
 c:\users\sm\appdata\local\temp\pip-install-vu2sb5\jnius\

I restarted CMD, but it didn't help.

Enthusiast
  • 31
  • 1
  • 4

3 Answers3

2

I have resolved the problem in windows os.

1st step:

I have installed cython by using pip install cython

C:\Users>pip install cython

Collecting cython Downloading Cython-0.29.22-cp38-cp38-win_amd64.whl (1.7 MB) |████████████████████████████████| 1.7 MB 1.3 MB/s Installing collected packages: cython Successfully installed cython-0.29.22

2nd step:

I have installed jnius by using pip install pyjnius command

C:\Users>pip install pyjnius

Collecting pyjnius Downloading pyjnius-1.3.0-cp38-cp38-win_amd64.whl (226 kB) |████████████████████████████████| 226 kB 3.2 MB/s Requirement already satisfied: cython in c:\users\sss\appdata\local\programs\python\python38\lib\site-packages (from pyjnius) (0.29.22) Requirement already satisfied: six>=1.7.0 in c:\users\sss\appdata\local\programs\python\python38\lib\site-packages (from pyjnius) (1.15.0) Installing collected packages: pyjnius Successfully installed pyjnius-1.3.0

I hope this solves your problem.

Shanmukh0109
  • 31
  • 1
  • 4
1

I have finally resolved it. I have installed Cython before this happened and I installed both Java JDK and JRE after @Chris comment. And I have also added JAVA_HOME and JDK_HOME to system variables.Thank you @Chris, but it didn't resolve problem completely.

Then I got another error message. There was written that I have to install Microsoft Visual C++ Compiler for Python 2.7 from this page: https://www.microsoft.com/en-us/download/confirmation.aspx?id=44266

After that I tried to install jnius again but the error message said that permission is denied so I ran CMD as administrator and finally installed jnius by typing pip install jnius.

I spent a lot of time to resolve it and hope that it will help everyone with same or similar problem.

Enthusiast
  • 31
  • 1
  • 4
0

The thing that worked for me was simply adding JAVA_HOME and JDK_HOME variables.