[Python-modules-team] Bug#961629: /usr/bin/virtualenv: Re: python3-virtualenv: Fails to create a Python 3.7 environment
ottakar
ottakar at freezed.me
Mon Jun 15 23:06:53 BST 2020
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,PythonActivator,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/_internal/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/_internal/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/_internal/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/_internal/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/_internal/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/main.py", line 10, in <module>
from pip._internal.cli.autocompletion import autocomplete
File "/home/user/.venvpylocal37/lib/python3.7/site-packages/pip/_internal/cli/autocompletion.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/main_parser.py", line 7, in <module>
from pip._internal.cli import cmdoptions
File "/home/user/.venvpylocal37/lib/python3.7/site-packages/pip/_internal/cli/cmdoptions.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/progress_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.
-- System Information:
Debian Release: bullseye/sid
APT prefers testing
APT policy: (500, 'testing')
Architecture: amd64 (x86_64)
Kernel: Linux 5.6.0-2-amd64 (SMP w/4 CPU cores)
Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8), LANGUAGE=fr_FR.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled
Versions of packages python3-virtualenv depends on:
ii python-pip-whl 20.1.1-2
ii python3 3.8.2-3
ii python3-appdirs 1.4.4-1
ii python3-distlib 0.3.0-1
ii python3-distutils 3.8.3-2
ii python3-filelock 3.0.12-2
ii python3-importlib-metadata 1.6.0-2
ii python3-pip 20.1.1-2
ii python3-pkg-resources 46.1.3-1
ii python3-six 1.15.0-1
python3-virtualenv recommends no packages.
python3-virtualenv suggests no packages.
-- no debconf information
More information about the Python-modules-team
mailing list