The instructions that Blubber generates for installing python packages no longer work on Bookworm. For example:
RUN python3 "-m" "pip" "install" "-U" "setuptools!=60.9.0" && python3 "-m" "pip" "install" "-U" "wheel" "tox" "pip" #12 1.446 error: externally-managed-environment #12 1.446 #12 1.446 × This environment is externally managed #12 1.446 ╰─> To install Python packages system-wide, try apt install #12 1.446 python3-xyz, where xyz is the package you are trying to #12 1.446 install. #12 1.446 #12 1.446 If you wish to install a non-Debian-packaged Python package, #12 1.446 create a virtual environment using python3 -m venv path/to/venv. #12 1.446 Then use path/to/venv/bin/python and path/to/venv/bin/pip. Make #12 1.446 sure you have python3-full installed. #12 1.446 #12 1.446 If you wish to install a non-Debian packaged Python application, #12 1.446 it may be easiest to use pipx install xyz, which will manage a #12 1.446 virtual environment for you. Make sure you have pipx installed. #12 1.446 #12 1.446 See /usr/share/doc/python3.11/README.venv for more information. #12 1.446 #12 1.446 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. #12 1.446 hint: See PEP 668 for the detailed specification.
As stated in the error message, there are two options for working around this:
- Pass --break-system-packages to pip (but only if needed). This is the easiest approach but leaves the risk in place.
- https://gitlab.wikimedia.org/repos/releng/blubber/-/merge_requests/61
- Release Blubber buildkit v0.20.0: https://gitlab.wikimedia.org/repos/releng/blubber/-/tags/v0.20.0
- Use a virtualenv as the holding place for packages. Not at this time. (Eventually completed in T357548, which also undoes the --break-system-packages hack)