error: 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 use apt upgrade and update.
5
Answers
You can use python
venv
like described here.However if you really want to install packages that way, then there are couple solutions:
/usr/lib/python3.x/EXTERNALLY-MANAGED
,pip
‘s argument--break-system-packages
,~/.config/pip/pip.conf
:that issue from pip just run the command and it will downgrade it.
=> pip install pip==22.3.1 –break-system-packages
surely that will help.
To fix that error you can use a python virtual environment. Here is how you can do that.
Install python virtual environment
Then you can move into a directory that you wish and create a virtual environment using
virtual env your_folder_name
While in the environment you have created type
source bin/activate
Here is an easy way (video)
Then that is it
I installed pipx first:
Then I used
pipx
to installradian
:Later to confirm the installation location (in my case to configure VSCode) I ran:
Happens to me after I changed the name of the folder containing my virtual environment
If you want to rename a virtual environment, changing the name of the folder doesn’t work, what I did was re-creating it