I have been trying to install pyjnius through the pip command pip install pyjnius and pip install git+git://github.com/kivy/pyjnius.git but all seem to be returning the below error code.

  Collecting git+git://github.com/kivy/pyjnius.git
  Cloning git://github.com/kivy/pyjnius.git to c:\temp\pip-req-build-7d_4quh2

    ERROR: Command errored out with exit status 1:
     command: 'c:\users\user\pycharmprojects\kivy_project\venv\scripts\python
.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Temp\\pip-
req-build-7d_4quh2\\setup.py'"'"'; __file__='"'"'C:\\Temp\\pip-req-build-7d_4
quh2\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=
f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, _
_file__, '"'"'exec'"'"'))' egg_info --egg-base 'C:\Temp\pip-pip-egg-info-6mu1
ulvw'
         cwd: C:\Temp\pip-req-build-7d_4quh2\
    Complete output (9 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "C:\Temp\pip-req-build-7d_4quh2\setup.py", line 95, in <module>
        compile_native_invocation_handler(*get_possible_homes(PLATFORM))
      File "jnius\env.py", line 172, in get_possible_homes
        get_jdk_home(platform),
      File "jnius\env.py", line 142, in get_jdk_home
        raise Exception('Unable to determine JDK_HOME')
    Exception: Unable to determine JDK_HOME
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check
 the logs for full command output.

Please any one give me a solution to this because I am kinda new to this kivy of a thing.

1

There are 1 best solutions below

0
On

The error message is showing the reason it's failing:

Exception: Unable to determine JDK_HOME

Make sure you have JDK (Java Development Kit) installed. If JDK is installed and it's still not working, try setting the JDK_HOME environment variable to point to the correct location.

Here's where the error message is being thrown, for reference: https://github.com/kivy/pyjnius/blob/7dd6c8e679302526d6e86bdddeca343a3f0b54c7/jnius/env.py#L118-L144