Installation for PyJNIus - PermissionError: [WinError 5] Acess denied

326 views
Skip to first unread message

Kit Wai

unread,
Apr 9, 2020, 9:29:38 AM4/9/20
to Kivy users support
I have tried the following measures, but error still pops up 
- Run the cmd in administrator role
- Set myself as pycham and python files in administrator role
- Used pip install --user PyJNIus
- Used python -m pip install --user PyJNIus
- Closed Pycham, and run cmd in administrator role
- I am already having the highest access right for all files

Can anyone help me out?


C:\WINDOWS\system32>python -m pip install --user PyJNIus
Collecting PyJNIus
  Using cached pyjnius-1.2.1.tar.gz (40 kB)
    ERROR: Command errored out with exit status 1:
     command: 'C:\Users\tom\AppData\Local\Programs\Python\Python38-32\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\tom\\AppData\\Local\\Temp\\pip-install-ueh9n_76\\PyJNIus\\setup.py'"'"'; __file__='"'"'C:\\Users\\tom\\AppData\\Local\\Temp\\pip-install-ueh9n_76\\PyJNIus\\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:\Users\tom\AppData\Local\Temp\pip-install-ueh9n_76\PyJNIus\pip-egg-info'
         cwd: C:\Users\tom\AppData\Local\Temp\pip-install-ueh9n_76\PyJNIus\
    Complete output (15 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "C:\Users\tom\AppData\Local\Temp\pip-install-ueh9n_76\PyJNIus\setup.py", line 92, in <module>
        compile_native_invocation_handler(*get_possible_homes(PLATFORM))
      File "C:\Users\tom\AppData\Local\Temp\pip-install-ueh9n_76\PyJNIus\setup.py", line 82, in compile_native_invocation_handler
        subprocess.check_call([
      File "C:\Users\tom\AppData\Local\Programs\Python\Python38-32\lib\subprocess.py", line 359, in check_call
        retcode = call(*popenargs, **kwargs)
      File "C:\Users\tom\AppData\Local\Programs\Python\Python38-32\lib\subprocess.py", line 340, in call
        with Popen(*popenargs, **kwargs) as p:
      File "C:\Users\tom\AppData\Local\Programs\Python\Python38-32\lib\subprocess.py", line 854, in __init__
        self._execute_child(args, executable, preexec_fn, close_fds,
      File "C:\Users\tom\AppData\Local\Programs\Python\Python38-32\lib\subprocess.py", line 1307, in _execute_child
        hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
    PermissionError: [WinError 5] Acess denied
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

Robert Flatt

unread,
Apr 9, 2020, 1:48:36 PM4/9/20
to Kivy users support
1) Don't do this as Administrator
2) Kivy 1.11.1 does not work on Python 3.8, so I'd guess pyjnius is the same.
3) I think your setup is right on this, but to be certain: don't install Python as Admin and use the default single user install.
4) If you reinstall Python check for legacy entries in the environment variables.

KC Pullen

unread,
May 4, 2020, 10:56:23 PM5/4/20
to Kivy users support

Hello,

I'm new to Kivy and I've run into the same error... and I'm actually pulling out the little hair that I have left...  I've tried to install as Administrator as well... still no luck... any ideas ?  Haven't found much luck on Stackoverflow either.... 

Here is my traceback:

C:\Users\Home>pip install pyjnius
Collecting pyjnius
  Using cached pyjnius-1.3.0.0.tar.gz (46 kB)
    ERROR: Command errored out with exit status 1:
     command: 'c:\users\home\appdata\local\programs\python\python37-32\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Home\\AppData\\Local\\Temp\\pip-install-_0fj_hsk\\pyjnius\\setup.py'"'"'; __file__='"'"'C:\\Users\\Home\\AppData\\Local\\Temp\\pip-install-_0fj_hsk\\pyjnius\\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:\Users\Home\AppData\Local\Temp\pip-pip-egg-info-9n644t3p'
         cwd: C:\Users\Home\AppData\Local\Temp\pip-install-_0fj_hsk\pyjnius\
    Complete output (15 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "C:\Users\Home\AppData\Local\Temp\pip-install-_0fj_hsk\pyjnius\setup.py", line 95, in <module>
        compile_native_invocation_handler(*get_possible_homes(PLATFORM))
      File "C:\Users\Home\AppData\Local\Temp\pip-install-_0fj_hsk\pyjnius\setup.py", line 87, in compile_native_invocation_handler
        join('jnius', 'src', 'org', 'jnius', 'NativeInvocationHandler.java')
      File "c:\users\home\appdata\local\programs\python\python37-32\lib\subprocess.py", line 342, in check_call
        retcode = call(*popenargs, **kwargs)
      File "c:\users\home\appdata\local\programs\python\python37-32\lib\subprocess.py", line 323, in call
        with Popen(*popenargs, **kwargs) as p:
      File "c:\users\home\appdata\local\programs\python\python37-32\lib\subprocess.py", line 775, in __init__
        restore_signals, start_new_session)
      File "c:\users\home\appdata\local\programs\python\python37-32\lib\subprocess.py", line 1178, in _execute_child
        startupinfo)
    PermissionError: [WinError 5] Access is denied
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.


Thanks in advance, 

KP

KC Pullen

unread,
May 4, 2020, 11:17:33 PM5/4/20
to Kivy users support

I'm also working in Windows 10.... 

Robert Flatt

unread,
May 4, 2020, 11:29:29 PM5/4/20
to Kivy users support
This is some kind of install issue.

I just tried it on python3.8-64 it worked, see below (use you should 3.7 not 3.8)

So probably some file/directory permissions issue, perhaps related to doing things as Admin?
Take a look at the permissions in   appdata\local\programs\python\python38\lib\site-packages

If you have installed Python more than once, also check %PATH% doesn't include old installs.

If all else fails, uninstall Python, clean any remaining folders, and reinstall. NOT as Admin.


C:\Users\bobf\Documents>pip install pyjnius
Collecting pyjnius
  Downloading pyjnius-1.3.0-cp38-cp38-win_amd64.whl (226 kB)
     |████████████████████████████████| 226 kB 504 kB/s
Requirement already satisfied: six>=1.7.0 in c:\users\bobf\appdata\local\programs\python\python38\lib\site-packages (from pyjnius) (1.14.0)
Collecting cython
  Downloading Cython-0.29.17-cp38-cp38-win_amd64.whl (1.7 MB)
     |████████████████████████████████| 1.7 MB 6.4 MB/s
Installing collected packages: cython, pyjnius
Successfully installed cython-0.29.17 pyjnius-1.3.0

KC Pullen

unread,
May 4, 2020, 11:41:23 PM5/4/20
to Kivy users support

Robert, 

I'll definitely try this and let you know what happens tomorrow.   Another question, is there a major difference between the 32 bit version and 64 bit version of Python?  Which is the preferred?

-KP

KC Pullen

unread,
May 5, 2020, 6:36:20 PM5/5/20
to Kivy users support


OK....  

I tried the following and it has been to no avail:

1.) Uninstall Python, reinstall Python 3.7.7 (32-bit), then "pip install pyjnius"

     a.) Uncompressed the file.
     b.) Opened the CMD window
     c.) Went to the downloaded directory, C:\Users\Home\Downloads\pyjnius-1.3.0.tar\dist\pyjnius-1.3.0\pyjnius-1.3.0 
     d.) Executed the following command: executed the following command: python setup.py

3.) Attempted to install from its git repo.
     a.) Tried - pip install git+git://github.com/kivy/pyjnius.git#egg=pyjnius
     b.) Tried - pip install git+https://github.com/kivy/pyjnius.git#egg=pyjnius

I wonder if there is an issue with the "setup.py" file as  each effort resulted in the same error message:

Traceback (most recent call last):
  File "setup.py", line 95, in <module>
    compile_native_invocation_handler(*get_possible_homes(PLATFORM))
  File "setup.py", line 87, in compile_native_invocation_handler
    join('jnius', 'src', 'org', 'jnius', 'NativeInvocationHandler.java')
  File "C:\Users\Home\AppData\Local\Programs\Python\Python37-32\lib\subprocess.py", line 358, in check_call
    retcode = call(*popenargs, **kwargs)
  File "C:\Users\Home\AppData\Local\Programs\Python\Python37-32\lib\subprocess.py", line 339, in call
    with Popen(*popenargs, **kwargs) as p:
  File "C:\Users\Home\AppData\Local\Programs\Python\Python37-32\lib\subprocess.py", line 800, in __init__
    restore_signals, start_new_session)
  File "C:\Users\Home\AppData\Local\Programs\Python\Python37-32\lib\subprocess.py", line 1207, in _execute_child
    startupinfo)
PermissionError: [WinError 5] Access is denied


Any other suggestions?  On the https://github.com/kivy/pyjnius/releases page, I see several 64-bit wheels, but only one option for 32-bit.  

I'm almost at wit's end. 

Robert Flatt

unread,
May 5, 2020, 7:25:03 PM5/5/20
to Kivy users support
Its OK to be crazy. Lots of us are like that. You are not alone:


I just Googled WinError 5  , seems it is a generic error message, often meaning 'cant find' rather than 'can find but not allowed'

I suggest joining the dialog on issue 504.

KC Pullen

unread,
May 5, 2020, 8:37:08 PM5/5/20
to Kivy users support

LOL @ crazy....  It feels good to know that I'm not alone...  

I've posted a message with the dialog on issue 504.   If anyone presents a solution, I'll post it in this thread.


Thanks,

KP
Reply all
Reply to author
Forward
0 new messages