ironsheep / RPi-Reporter-MQTT2HA-Daemon

Linux service to collect and transfer Raspberry Pi data via MQTT to Home Assistant (for RPi Monitoring)
GNU General Public License v3.0
441 stars 62 forks source link

Bookworm causing "externally-managed-environment" error #108

Closed Trblz42 closed 10 months ago

Trblz42 commented 10 months ago

Checklist:

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 10 months ago

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

Trblz42 commented 10 months ago

thanks - i will continue the chat in #103