Hi Jens,

The quick-fix would be to add `--break-system-packages` to the `python3 -m
pip install` command to overcome the issue.
There might be a better long term solution that I am yet to find. My
opinion is that since it is in a docker container it should be fine to
suppress the warning using the flag, I might be wrong or mistaken.

PEP 668 explains this: https://peps.python.org/pep-0668/
Section 5 states: "A distro Python when used in a single-application
container image (e.g., a Docker container). In this use case, the risk of
breaking system software is lower, since generally only a single
application runs in the container, and the impact is lower, since you can
rebuild the container and you don’t have to struggle to recover a running
machine. There are also a large number of existing Dockerfiles with an
unqualified RUN pip install ... statement, etc., and it would be good not
to break those. So, builders of base container images may want to ensure
that the marker file is not present, even if the underlying OS ships one by
default."

I made a PR in this effect: https://github.com/apache/thrift/pull/3380

Regards,
Carel

On Wed, 8 Apr 2026 at 01:02, Jens Geyer <[email protected]> wrote:

> Hi,
>
> actually I could indeed need some help: This is what
>
>      docker build -t thrift build/docker/ubuntu-noble
>
> produces. Something wth the recent py changes is not perfect:
>
>
>   => ERROR [28/37] RUN python3 -m pip install --no-cache-dir --upgrade
> "tornado>=6.3.0" "twisted>=24.3.0" "zope.in  0.8s
> ------
>   > [28/37] RUN python3 -m pip install --no-cache-dir --upgrade
> "tornado>=6.3.0" "twisted>=24.3.0" "zope.interface>=6.1":
> 0.689 error: externally-managed-environment
> 0.689
> 0.689 × This environment is externally managed
> 0.689 ╰─> To install Python packages system-wide, try apt install
> 0.689     python3-xyz, where xyz is the package you are trying to
> 0.689     install.
> 0.689
> 0.689     If you wish to install a non-Debian-packaged Python package,
> 0.689     create a virtual environment using python3 -m venv path/to/venv.
> 0.689     Then use path/to/venv/bin/python and path/to/venv/bin/pip. Make
> 0.689     sure you have python3-full installed.
> 0.689
> 0.689     If you wish to install a non-Debian packaged Python application,
> 0.689     it may be easiest to use pipx install xyz, which will manage a
> 0.689     virtual environment for you. Make sure you have pipx installed.
> 0.689
> 0.689     See /usr/share/doc/python3.12/README.venv for more information.
> 0.689
> 0.689 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.
> 0.689 hint: See PEP 668 for the detailed specification.
> ------
>
>   15 warnings found (use docker --debug to expand):
>   - LegacyKeyValueFormat: "ENV key=value" should be used instead of
> legacy "ENV key value" format (line 148)
>   - LegacyKeyValueFormat: "ENV key=value" should be used instead of
> legacy "ENV key value" format (line 309)
>   - LegacyKeyValueFormat: "ENV key=value" should be used instead of
> legacy "ENV key value" format (line 78)
>   - LegacyKeyValueFormat: "ENV key=value" should be used instead of
> legacy "ENV key value" format (line 85)
>   - LegacyKeyValueFormat: "ENV key=value" should be used instead of
> legacy "ENV key value" format (line 110)
>   - LegacyKeyValueFormat: "ENV key=value" should be used instead of
> legacy "ENV key value" format (line 177)
>   - LegacyKeyValueFormat: "ENV key=value" should be used instead of
> legacy "ENV key value" format (line 269)
>   - LegacyKeyValueFormat: "ENV key=value" should be used instead of
> legacy "ENV key value" format (line 156)
>   - LegacyKeyValueFormat: "ENV key=value" should be used instead of
> legacy "ENV key value" format (line 157)
>   - LegacyKeyValueFormat: "ENV key=value" should be used instead of
> legacy "ENV key value" format (line 284)
>   - LegacyKeyValueFormat: "ENV key=value" should be used instead of
> legacy "ENV key value" format (line 97)
>   - LegacyKeyValueFormat: "ENV key=value" should be used instead of
> legacy "ENV key value" format (line 126)
>   - LegacyKeyValueFormat: "ENV key=value" should be used instead of
> legacy "ENV key value" format (line 155)
>   - LegacyKeyValueFormat: "ENV key=value" should be used instead of
> legacy "ENV key value" format (line 109)
>   - LegacyKeyValueFormat: "ENV key=value" should be used instead of
> legacy "ENV key value" format (line 130)
> Dockerfile:258
> --------------------
>   256 |           python3-wheel
>   257 |
>   258 | >>> RUN python3 -m pip install --no-cache-dir --upgrade
> "tornado>=6.3.0" "twisted>=24.3.0" "zope.interface>=6.1"
>   259 |
>   260 |     RUN apt-get install -y --no-install-recommends \
> --------------------
> ERROR: failed to build: failed to solve: process "/bin/sh -c python3 -m
> pip install --no-cache-dir --upgrade \"tornado>=6.3.0\"
> \"twisted>=24.3.0\" \"zope.interface>=6.1\"" did not complete
> successfully: exit code: 1
>
> The env key stuff can be ignored for now. But the error is a blocker.
>
> Thanks for any help,
> JensG
>
>
>
> Am 07.04.2026 um 14:20 schrieb Carel Combrink:
> > Hi Jens,
> >
> > I see my last PR was merged, thanks for that.
> >
> > Any progress on the release?
> >
> > Please shout if there is something that I can do to help if there is
> > something that needs a hand.
> >
> > Regards,
> > Carel
>

Reply via email to