-
Notifications
You must be signed in to change notification settings - Fork 0
Troubleshooting
Ousmane edited this page Feb 9, 2025
·
9 revisions
If you have this output when you are using pip:
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.12/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.
You can use the following command to bypass the error:
sudo rm /usr/lib/python3.*/EXTERNALLY-MANAGEDBy launching the tests scripts, you may have the following permission error:
RuntimeError: No access to /dev/mem. Try running as root!To fix this issue, you can create a 'gpio.rules' file:
sudo nano /etc/udev/rules.d/gpio.rulesWrite this line inside the file:
KERNEL=="gpiomem", GROUP="gpio", MODE="0660"
Save the file and exit, then reload the udev rules:
sudo udevadm control --reload-rules
sudo udevadm triggerIf you come across any other errors, please don't hesitate to let me know!