Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error: externally-managed-environment #135

Open
geekworm-com opened this issue Nov 16, 2023 · 2 comments
Open

error: externally-managed-environment #135

geekworm-com opened this issue Nov 16, 2023 · 2 comments

Comments

@geekworm-com
Copy link

I found the following errors on Raspberry Pi 5 Model B;

pi@raspberrypi:~/stressberry $ python3 -m pip install stressberry
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.

For more information visit http://rptl.io/venv

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.

Are there some updates?

@shortbloke
Copy link
Contributor

I believe this is expected with Python 3.11 and the implementation of PEP668 as per the message you have two options in this case:

  1. Install with the flag --break-system-packages
  2. setup a venv and run pip and stressberry from there.

I believe if you installed Python 3.11 or later on any RPi 4 you'd see the same issue.

@Ate329
Copy link

Ate329 commented Jan 6, 2024

I encountered the same issue and you can try to use this command (if you are using python3.11):
sudo mv /usr/lib/python3.11/EXTERNALLY-MANAGED /usr/lib/python3.11/EXTERNALLY-MANAGED.old
There are other solutions in this stackoverflow question: https://stackoverflow.com/questions/75608323/how-do-i-solve-error-externally-managed-environment-every-time-i-use-pip-3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants