Greetings fellow Jamming Jellyfish
GitHub announced on September 25th that Ubuntu 24.04 LTS was GA for GitHub Actions, and that they would be gradually migrating jobs using the ubuntu-latest
label from 22.04 and 24.04 through October 30th:
However, a key change from 22.04 LTS to 24.04 LTS is that you cannot use pip
to install system-level packages. If you try to install a system-level Python dependency using pip
- say sudo python3 -m pip install tox
to get the latest and greatest tox version from @jugmac00 - you will see the following error message on ubuntu-latest
if GitHub has migrated you to Ubuntu 24.04 LTS:
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.
hint: See PEP 668 for the detailed specification.
This error will cause your GitHub Actions to wig out and fail. HPC noticed this issue yesterday when all our CI jobs started to fail for our charms
If you’re using the ubuntu-latest
label, this would be a great time to check if you’re using the system pip
to install Python packages in your repository actions!