On 13 November 2017 at 04:38, Antoine Pitrou email@example.com wrote:
On Sun, 12 Nov 2017 12:20:45 +0000 Paul Moore firstname.lastname@example.org wrote:
Well, not exactly. Do you do python -m venv, or py -x.x -m venv or pythonx -m venv ? Wait, it's not installed by default on debian.
Seriously? Debian don't provide venv in the standard Python install? That's just broken.
Frankly, I don't know where the current discussion comes from, but on two recent Debian and Ubuntu setups, I get:
$ dpkg -S /usr/lib/python3.5/venv/__init__.py libpython3.5-stdlib:amd64: /usr/lib/python3.5/venv/__init__.py
The discussion comes from the fact that even though the code is present it doesn't actually work:
$ docker run --rm -it ncoghlan/debian-python bash root@e9c0aa482aeb:/# python3 -m venv test_venv Error: Command '['/test_venv/bin/python3', '-Im', 'ensurepip', '--upgrade', '--default-pip']' returned non-zero exit status 1
(I just refreshed my Docker image to 9.2, so that's the current default behaviour after "apt-get install -y python3")
So technically it's ensurepip that's broken by default, but that translates to venv also being broken by default.
I haven't worked out what the actual steps needed to fix it are (but I do know that installing "python3-pip" isn't enough the way it is on Fedora - we reconcile ensurepip with our security management policies by having a Recommends dep from python3 to python3-pip, and then patching ensurepip to use rewheel to inject a copy of the system pip into freshly created virtual environments. At least in theory, Debian should be able to do something similar with dirtbike, but whether or not they actually will would be a question for Matthias Klose as the Debian Python maintainer).