Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use system package for virtualenv on Debian-based systems #99

Closed
wants to merge 0 commits into from

Conversation

robwoolley
Copy link
Contributor

As of Debian 12, running pip3 install virtualenv will give the error:
error: externally-managed-environment

It recommends using apt to install system-wide packages instead of pip3.
This only affects virtualenv as it is the only Python module installed
with pip3 outside of a virtual environment.

All recent Debian and Ubuntu releases seem to have python3-virtualenv
packaged so we can just add it to the package list installed by apt.

I did not check the other distros, however I took the approach of making
the install command customizable per distro to preserve the current
behaviour and provide a means to selectively migrate each distro to using
the distro package management.

Signed-off-by: Rob Woolley rob.woolley@windriver.com

@moto-timo
Copy link
Member

moto-timo commented Mar 16, 2024

There is a goal to try to make all the distros behave as similarly as possible. This is why all of them used pip to install virtualenv up to now. Debian 12 is the first distro to use the newish "externally-managed" twist. IMHO, we should investigate installing virtualenv from distro package feeds for all the distros. Not sure what possible side effects there might be.

I'll also point out that the original reason for virtualenv was for testing only and not intended to be used in the resulting docker container. We were trying to keep the containers as small as reasonably possible. Given the speed of development of modern python, it is much more likely that someone will need to install additional python modules for their given development/CI workflow. So just like having pip installed in the containers became highly desirable, it is also likely time to add virtualenv to all the containers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants