Errno 13 Permission denied when pip upgrade or pip install
0
votes
2
answers
3801
views
I have set up my virtual ennvironment and i'm trying to install the package but i keep on running into this error :
: Could not install packages due to an OSError: [Errno 13] Permission denied: '/home/daeltam/.MyVenv/lib/python3.11/site-packages/propcache' Check the permissions.
This happens when i run :
- -m pip install discord
- install discord --user
- install discord
All of those tests have been made looking at forums. But the majority of them advice to create a virtualenv to fix this, which is already the case for me...
Running sudo pip install --upgrade pip
only gives me this error message i can't understand, no matter if i'm inside the venv or not :
: externally-managed-environment
× This environment is externally managed
╰─> To install Python packages system-wide, try apt install
python3-xyz, where xyz is the package you are trying to
install.
If you wish to install a non-Debian-packaged Python package,
create a virtual environment using python3 -m venv path/to/venv.
Then use path/to/venv/bin/python and path/to/venv/bin/pip. Make
sure you have python3-full installed.
If you wish to install a non-Debian packaged Python application,
it may be easiest to use pipx install xyz, which will manage a
virtual environment for you. Make sure you have pipx installed.
See /usr/share/doc/python3.11/README.venv for more information.
note: If you believe this is a mistake, please contact your Python installation or OS distribution provider. You can override this, at the risk of breaking your Python installation or OS, by passing --break-system-packages.
hint: See PEP 668 for the detailed specification
I am on debian if this is useful, i'm a newbie regarding linux and permissions are still a little bit obscure for me even after reading articles to understand.
**Edit with my progress :**
As below comments and answers seem to say, the problem might have been me setting up my venv with sudo during one of my tests.
So what i just tried is deleting the venv ( with sudo rm -rf .venv
)
and then creating one back with python3 -m venv .MyVenv
(i prefer that name)
But i got this error message once again : Error: [Errno 13] Permission denied: '/home/daeltam/Daeltam/.MyVenv/pyvenv.cfg'
I can still activate the Venv with source Path/bin/activate but i haven't made more tests.
Asked by Daeltam
(13 rep)
Jan 1, 2025, 01:47 PM
Last activity: Jan 14, 2025, 03:25 PM
Last activity: Jan 14, 2025, 03:25 PM