Pyjnius Installation on windows 10 64 bit

95 views
Skip to first unread message

David Akinpelu

unread,
Mar 30, 2023, 3:01:10 AM3/30/23
to Kivy users support
I am unable to install pyjnius on a windows machine using `pip install  pyjnius`.

I have jdk-20 and jre1.8.0_3.61 installed. I got the following error

```
Obtaining file:///C:/Users/tadeye2/David/FlexNeuART
  Preparing metadata (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [45 lines of output]
        error: subprocess-exited-with-error

        Getting requirements to build wheel did not run successfully.
        exit code: 1

        [27 lines of output]
        warning: [options] bootstrap class path not set in conjunction with -source 7
        error: Source option 7 is no longer supported. Use 8 or later.
        error: Target option 7 is no longer supported. Use 8 or later.
        Traceback (most recent call last):
          File "C:\Users\tadeye2\.conda\envs\flexneuart\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 353, in <module>
            main()
          File "C:\Users\tadeye2\.conda\envs\flexneuart\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 335, in main
            json_out['return_val'] = hook(**hook_input['kwargs'])
                                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
          File "C:\Users\tadeye2\.conda\envs\flexneuart\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 118, in get_requires_for_build_wheel
            return hook(config_settings)
                   ^^^^^^^^^^^^^^^^^^^^^
          File "C:\Users\tadeye2\AppData\Local\Temp\pip-build-env-awgzaujy\overlay\Lib\site-packages\setuptools\build_meta.py", line 338, in get_requires_for_build_wheel
            return self._get_build_requires(config_settings, requirements=['wheel'])
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
          File "C:\Users\tadeye2\AppData\Local\Temp\pip-build-env-awgzaujy\overlay\Lib\site-packages\setuptools\build_meta.py", line 320, in _get_build_requires
            self.run_setup()
          File "C:\Users\tadeye2\AppData\Local\Temp\pip-build-env-awgzaujy\overlay\Lib\site-packages\setuptools\build_meta.py", line 485, in run_setup
            self).run_setup(setup_script=setup_script)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
          File "C:\Users\tadeye2\AppData\Local\Temp\pip-build-env-awgzaujy\overlay\Lib\site-packages\setuptools\build_meta.py", line 335, in run_setup
            exec(code, locals())
          File "<string>", line 87, in <module>
          File "<string>", line 77, in compile_native_invocation_handler
          File "C:\Users\tadeye2\.conda\envs\flexneuart\Lib\subprocess.py", line 413, in check_call
            raise CalledProcessError(retcode, cmd)
        subprocess.CalledProcessError: Command '['C:\\Program Files\\Java\\jdk-20\\bin\\javac.exe', '-target', '1.7', '-source', '1.7', 'jnius\\src\\org\\jnius\\NativeInvocationHandler.java']' returned non-zero exit status 2.
        [end of output]

        note: This error originates from a subprocess, and is likely not a problem with pip.
      error: subprocess-exited-with-error

      Getting requirements to build wheel did not run successfully.
      exit code: 1

      See above for output.

      note: This error originates from a subprocess, and is likely not a problem with pip.
      Failed to install requirements from the file requirements.txt
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.
```

Robert

unread,
Mar 30, 2023, 3:22:40 AM3/30/23
to Kivy users support
I don't know the answer to your question.

But just in case this is to use the Android api (which is what almost everybody uses it for) - that api is not executable on platforms other than Android (so not Windows). See https://github.com/Android-for-Python/Android-for-Python-Users#pyjnius  If this is the use case, the answer to your question is not going to help you.

 

echidne

unread,
Mar 30, 2023, 5:40:10 AM3/30/23
to Kivy users support
I noticed that you are using conda environment. Did you try to install the package through Conda?  https://anaconda.org/conda-forge/pyjnius?

David Akinpelu

unread,
Mar 31, 2023, 6:15:53 PM3/31/23
to Kivy users support
@echidne. Installing the package through Conda works. Thanks!
Reply all
Reply to author
Forward
0 new messages