I have just upgraded my Raspi to bookworm and Python 3.11.2
The upgrade went fine, but after boot I realized and don’t have Iris running.
Trying to install it again with:
sudo python3 -m pip install Mopidy-Iris
I got this error:
× 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
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.
sorry, I missed that. So, should I use
--break-system-packages even if it is scaring?
I have also read that the solution for Debian 12, at least, is to delete the
EXTERNALLY-MANAGED file in your system Python installation:
sudo rm -rf /usr/lib/python3.11/EXTERNALLY-MANAGED
Which should I use?
The in progress documentation recommends using
--break-system-packages. It worked on my system.
I am not comfortable with permanently disabling the warning as suggested in your second option.
But finally it’s your choice!
Either is fine if you’ve read and understood what it’s trying to do. Removing EXTERNALLY-MANAGED file will save you some key-presses down the line, but using
--break-system-packages only as and when you need it might save you from screwing up your system Python environment by accident one day (when installing some other random Python package that doesn’t play nicely). So far I’ve been going with
--break-system-packages as per the Mopidy docs. Perhaps the Python/Debian community will do something else because despite good intentions they’ve arguably made a bit of a mess here.
This new version of the installation documentation was written in preparation for the next major release of Mopidy that requires Python 3.11+ and GStreamer 1.22.0+, but that version won’t be released until Ubuntu 22.04 LTS becomes available (which provides these dependencies). However, this in progress documentation also includes this extra stuff now required for installing with pip. I will move that new pip stuff into the main docs since that is required right now as it’s confusing without it. Thanks for the reminder.
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.