Package: python3.9-venv
Version: 3.9.1-1
Severity: important
Dear Maintainer,
This hideous message sprung up again with python3.9
=========================
$> python3 -m venv myvenv
The virtual environment was not created successfully because ensurepip is not
available. On Debian/Ubuntu systems, you need to install the python3-venv
package using the following command.
apt-get install python3-venv
You may need to use sudo with that command. After installing the python3-venv
package, recreate your virtual environment.
========================
This has been reported before (here #816740 and here #901601), but my point is
that the message is misleading because the issue is not necessarily caused by
ensurepip actually missing and installing python3-venv does not fix it (it was
already installed as it was python3.9-venv).
After some research I found the cause of the issue: it was ensurepip failing
this assert
==============================================
142. wheel_names = glob.glob(
143. '/usr/share/python-wheels/{}-*.whl'.format(project))
144. assert len(wheel_names) == 1, wheel_names
============================================
because I had two files named
/usr/share/python-wheels/ipaddr-2.2.0-py3-none-any.whl
and
/usr/share/python-wheels/ipaddr-2.2.0-py2.py3-none-any.whl
The first one comes from the package python-pip-whl, the other one is a
mistery.
So I renamed the second one with some harmless name and `python3 -m venv`
started working again.
Now maybe /usr/share/python-wheels/ipaddr-2.2.0-py2.py3-none-any.whl was a
leftover from some old package (looks like some transition from python2) but
the point is sill that that message about installing python3-venv is triggered
by in a catch all exception around a subprocess call, anything that fails in
that call to `python -Im ensurepip` is reported as such.
Thanks
-- System Information:
Debian Release: bullseye/sid
APT prefers testing
APT policy: (900, 'testing'), (800, 'stable'), (700, 'unstable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386
Kernel: Linux 4.19.0-13-amd64 (SMP w/8 CPU threads)
Kernel taint flags: TAINT_PROPRIETARY_MODULE, TAINT_OOT_MODULE,
TAINT_UNSIGNED_MODULE
Locale: LANG=en_US.utf8, LC_CTYPE=en_US.utf8 (charmap=UTF-8), LANGUAGE=en_US:en
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled
Versions of packages python3.9-venv depends on:
ii python-pip-whl 20.1.1-2
ii python3-distutils 3.8.6-1
ii python3.9 3.9.1-1
python3.9-venv recommends no packages.
python3.9-venv suggests no packages.
-- no debconf information