WinError 5: Access is denied when install pip numba and librosa for Python

Viewed 327

On a Python project on Windows 10 (Python 3.8.1), I want to install the '''pip librosa''' library (for some personal project and practice for sound analysis/visualization).

The first problem, after test running on the IDLE/Shell window (of Python) is

 ModuleNotFoundError: No module named 'numba.decorators'

This is solved by

pip install numba==0.48

on the Command prompt window, as suggested here. The first try does not work out, so I quit the Command prompt, and then re-run it as Administrator. The result of the same prompt (install numba==0.48) is

ERROR: Could not install packages due to an EnvironmentError: [WinError 5] Access is denied: 
'C:\\Users\\admin\\AppData\\Local\\Programs\\Python\\Python38\\Lib\\site-packages\\~umba\\core\\runtime\\_nrt_python.cp38-win_amd64.pyd'
Consider using the `--user` option or check the permissions.

For reference, this is what shown on the Command prompt window at the latest try

Collecting numba==0.48
  Using cached numba-0.48.0-1-cp38-cp38-win_amd64.whl (2.1 MB)
Requirement already satisfied: llvmlite<0.32.0,>=0.31.0dev0 in c:\users\admin\appdata\local\programs\python\python38\lib\site-packages (from numba==0.48) (0.31.0)
Requirement already satisfied: setuptools in c:\users\admin\appdata\local\programs\python\python38\lib\site-packages (from numba==0.48) (41.2.0)
Requirement already satisfied: numpy>=1.15 in c:\users\admin\appdata\local\programs\python\python38\lib\site-packages (from numba==0.48) (1.19.0)
Installing collected packages: numba
  Attempting uninstall: numba
    Found existing installation: numba 0.50.1
    Uninstalling numba-0.50.1:
      Successfully uninstalled numba-0.50.1

ERROR: Could not install packages due to an EnvironmentError: [WinError 5] Access is denied: 
'C:\\Users\\admin\\AppData\\Local\\Programs\\Python\\Python38\\Lib\\site-packages\\~umba\\core\\runtime\\_nrt_python.cp38-win_amd64.pyd'
Consider using the `--user` option or check the permissions.

Thank you for your support.

1 Answers

I had the same problem with librosa. When I installed previous versions of librosa and numba the error message you provided occurred. And when I tried the last versions, the following code:

import librosa

just hung infinitely. It gave the following output on interruption:

Traceback (most recent call last):
  File "C:\Program Files\Python310\lib\tempfile.py", line 256, in _mkstemp_inner
    fd = _os.open(file, flags, 0o600)
PermissionError: [Errno 13] Permission denied: 'C:\\Program Files\\Python310\\lib\\site-packages\\librosa\\util\\__pycache__\\tmp0mmfetrz'

My solution was to install the last versions of librosa (0.9.1) and numba (0.55.2), and then run Python (PyCharm) with Administrator rights.

Here are some details on this issue: https://github.com/librosa/librosa/issues/987

Related