ironsheep/RPi-Reporter-MQTT2HA-Daemon

Bookworm causing "externally-managed-environment" error

Trblz42 opened this issue · 2 comments

Checklist:

  • [ X] I updated to the latest version available
  • [ X] I checked that my MQTT broker is otherwise working

Release with the issue:

Last working release (if known):

Hardware, Operating System, Python version:

Debian 12.1 (Bookworm) - fresh install

Description of problem:

sudo pip3 install -r requirements.txt

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.

Run our report script 'genBugInfo' on your failing device and include the output here:

genBugInfo.txt


Python errors shown in the logs (if applicable):


Additional information:

bsimmo commented

Welcome to a new world of python fun

You can force it to allow system wide installs.

The idea is to use apt packages for everything system wide so pip doesn't clash and damage the system.

Local users are fine (no sudo) or use virtual python environments to keep everything contained.

See #103

thanks - i will continue the chat in #103