[Python-modules-team] Bug#961629: Bug#961629: /usr/bin/virtualenv: Re: python3-virtualenv: Fails to create a Python 3.7 environment

Scott Kitterman debian at kitterman.com
Mon Jun 15 23:26:53 BST 2020


On Monday, June 15, 2020 6:06:53 PM EDT ottakar wrote:
> Package: python3-virtualenv
> Version: 20.0.21+ds-2
> Followup-For: Bug #961629
> 
> Dear Maintainer,
> 
> Could someone confirm I encountered the same bug?
> 
> I install a fresh `python3.7.7`, but `pip` fails inside virtual environments
> created with this installation.
> 
> $ virtualenv --clear -p ~/pylocal/bin/python3.7 .venvpylocal37
> created virtual environment CPython3.7.7.final.0-64 in 98ms
>   creator CPython3Posix(dest=/home/user/git/repo/.venvpylocal37, clear=True,
> global=False) seeder FromAppData(download=False, pip=latest,
> setuptools=latest, wheel=latest, pkg_resources=latest, via=copy,
> app_data_dir=/home/user/.local/share/virtualenv/seed-app-data/v1.0.1.debian
> ) activators
> BashActivator,CShellActivator,FishActivator,PowerShellActivator,PythonActiv
> ator,XonshActivator $ source .venvpylocal37/bin/activate;pip -V
> Traceback (most recent call last):
>   File "/home/user/git/repo/.venvpylocal37/bin/pip", line 5, in <module>
>     from pip._internal.cli.main import main
>     File
> "/home/user/git/repo/.venvpylocal37/lib/python3.7/site-packages/pip/_intern
> al/cli/main.py", line 10, in <module> from pip._internal.cli.autocompletion
> import autocomplete
>   File
> "/home/user/git/repo/.venvpylocal37/lib/python3.7/site-packages/pip/_intern
> al/cli/autocompletion.py", line 9, in <module> from
> pip._internal.cli.main_parser import create_main_parser
>   File
> "/home/user/git/repo/.venvpylocal37/lib/python3.7/site-packages/pip/_intern
> al/cli/main_parser.py", line 7, in <module> from pip._internal.cli import
> cmdoptions
>   File
> "/home/user/git/repo/.venvpylocal37/lib/python3.7/site-packages/pip/_intern
> al/cli/cmdoptions.py", line 24, in <module> from
> pip._internal.cli.progress_bars import BAR_TYPES
>   File
> "/home/user/git/repo/.venvpylocal37/lib/python3.7/site-packages/pip/_intern
> al/cli/progress_bars.py", line 7, in <module> from pip._vendor import six
> ImportError: cannot import name 'six' from 'pip._vendor'
> (/home/user/git/repo/.venvpylocal37/lib/python3.7/site-packages/pip/_vendor
> /__init__.py) zsh: exit 1     pip -V
> 
> 
> Python3 installation provided by OS : 3.8 is default, 3.7 is still there
> (almost partly) :
> 
> ~$ python3 -m pip -V
> pip 20.1.1 from /usr/lib/python3/dist-packages/pip (python 3.8)
> ~$ python3.7 -V
> Python 3.7.3
> ~$ python3.7 -m pip -V
> Traceback (most recent call last):
>   File "/usr/lib/python3.7/runpy.py", line 193, in _run_module_as_main
>     "__main__", mod_spec)
>   File "/usr/lib/python3.7/runpy.py", line 85, in _run_code
>     exec(code, run_globals)
>   File "/usr/lib/python3/dist-packages/pip/__main__.py", line 23, in
> <module> from pip._internal.cli.main import main as _main  # isort:skip #
> noqa File "/usr/lib/python3/dist-packages/pip/_internal/cli/main.py", line
> 10, in <module> from pip._internal.cli.autocompletion import autocomplete
>   File "/usr/lib/python3/dist-packages/pip/_internal/cli/autocompletion.py",
> line 9, in <module> from pip._internal.cli.main_parser import
> create_main_parser
>   File "/usr/lib/python3/dist-packages/pip/_internal/cli/main_parser.py",
> line 7, in <module> from pip._internal.cli import cmdoptions
>   File "/usr/lib/python3/dist-packages/pip/_internal/cli/cmdoptions.py",
> line 19, in <module> from distutils.util import strtobool
> ModuleNotFoundError: No module named 'distutils.util'
> 
> 
> My `python3.7.7` installation in _userland_ follows this way :
> https://unix.stackexchange.com/a/350985/280824. I try a `sudo make
> install`, it do not change situation.
> 
> ~$ ./pylocal/bin/python3.7 -m pip -V
> pip 19.2.3 from /home/user/pylocal/lib/python3.7/site-packages/pip (python
> 3.7) ~$ ./pylocal/bin/python3.7 -c 'from pip._vendor import six'
> ~$ source .venvpylocal37/bin/activate
> (.venvpylocal37) ~$ pip -V
> Traceback (most recent call last):
>   File "/home/user/.venvpylocal37/bin/pip", line 5, in <module>
>     from pip._internal.cli.main import main
>   File
> "/home/user/.venvpylocal37/lib/python3.7/site-packages/pip/_internal/cli/ma
> in.py", line 10, in <module> from pip._internal.cli.autocompletion import
> autocomplete
>   File
> "/home/user/.venvpylocal37/lib/python3.7/site-packages/pip/_internal/cli/au
> tocompletion.py", line 9, in <module> from pip._internal.cli.main_parser
> import create_main_parser
>   File
> "/home/user/.venvpylocal37/lib/python3.7/site-packages/pip/_internal/cli/ma
> in_parser.py", line 7, in <module> from pip._internal.cli import cmdoptions
>   File
> "/home/user/.venvpylocal37/lib/python3.7/site-packages/pip/_internal/cli/cm
> doptions.py", line 24, in <module> from pip._internal.cli.progress_bars
> import BAR_TYPES
>   File
> "/home/user/.venvpylocal37/lib/python3.7/site-packages/pip/_internal/cli/pr
> ogress_bars.py", line 7, in <module> from pip._vendor import six
> ImportError: cannot import name 'six' from 'pip._vendor'
> (/home/user/.venvpylocal37/lib/python3.7/site-packages/pip/_vendor/__init__
> .py)
> 
> For memory, I created an issue to `pypa/virtualenv` (they told me this is a
> Debian issue): https://github.com/pypa/virtualenv/issues/1860
> 
> Thanks you, and apologies if this is no appropriate : this is my first
> contribution to Debian BTS.

It's still not a virtualenv bug.

See the previous entry in this bug:

> This isn't a virtualenv bug.  This is a result of python3.7 being not yet
> completely removed from the archive for Testing/Unstable.  Virtualenv would
> work fine if there was a python3.7 version of distutils available, but there
> isn't.
> 
> Currently python3.8 is the only supported python3 version in Unstable and
> Testing.
> 
> $ py3versions -s
> python3.8

Python3.7 is NOT supported.  If you want to create your own python2.7 
environment, then you have to provide all the needed parts.  It's not a Debian 
issue.

FYI, the easiest way to do this is use Debian stable (which has python3.7 as 
the supported python3 version).

Scott K
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: This is a digitally signed message part.
URL: <http://alioth-lists.debian.net/pipermail/python-modules-team/attachments/20200615/485bac0b/attachment-0001.sig>


More information about the Python-modules-team mailing list