On 12/22/20 12:22 PM, Marco wrote:
> 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.

so what do you expect? cluttering the Debian installation with custom files and
then expecting everything to work?  Find out where that file came from ...

Reply via email to