Note: This is a public test instance of Red Hat Bugzilla. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback at bugzilla.redhat.com.
Bug 2272958 - `virtualenv --download --python python3.6 <venv>` fails
Summary: `virtualenv --download --python python3.6 <venv>` fails
Keywords:
Status: ON_QA
Alias: None
Product: Fedora
Classification: Fedora
Component: python-virtualenv
Version: 40
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Miro Hrončok
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2024-04-03 13:24 UTC by Miro Hrončok
Modified: 2024-04-19 21:30 UTC (History)
5 users (show)

Fixed In Version: python-virtualenv-20.21.1-16.fc41 python-virtualenv-20.21.1-7.fc38
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2024-04-14 03:08:09 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Fedora Package Sources python-virtualenv pull-request 107 0 None None None 2024-04-04 15:58:08 UTC

Description Miro Hrončok 2024-04-03 13:24:33 UTC
Description of problem:
It is not possible to use virtualenv --download with Python 3.6.

Version-Release number of selected component:
python3.6-3.6.15-29.fc41.x86_64
python3-virtualenv-20.21.1-9.fc40.noarch

How reproducible: Always


Steps to Reproduce:
1. $ sudo dnf install python3.6 virtualenv
2. $ virtualenv --download --python python3.6 venv

Actual results:
fail
Traceback (most recent call last):
  File "/usr/lib/python3.12/site-packages/virtualenv/seed/embed/via_app_data/via_app_data.py", line 83, in _get
    result = get_wheel(
             ^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/virtualenv/seed/wheels/acquire.py", line 27, in get_wheel
    wheel = download_wheel(
            ^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/virtualenv/seed/wheels/acquire.py", line 67, in download_wheel
    raise CalledProcessError(process.returncode, cmd, **kwargs)
subprocess.CalledProcessError: Command '['/usr/bin/python3', '-m', 'pip', 'download', '--progress-bar', 'off', '--disable-pip-version-check', '--only-binary=:all:', '--no-deps', '--python-version', '3.6', '-d', '/root/.local/share/virtualenv/wheel/house', 'wheel']' returned non-zero exit status 1.
failed to download wheel version bundle, pip download exit code 1
/usr/lib64/python3.6/ensurepip/_bundled/pip-18.1-py2.py3-none-any.whl/pip/_vendor/ipaddress.py:1106: SyntaxWarning: 'str' object is not callable; perhaps you missed a comma?
/usr/lib64/python3.6/ensurepip/_bundled/pip-18.1-py2.py3-none-any.whl/pip/_vendor/ipaddress.py:1106: SyntaxWarning: 'str' object is not callable; perhaps you missed a comma?
Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "/usr/lib64/python3.6/ensurepip/_bundled/pip-18.1-py2.py3-none-any.whl/pip/__main__.py", line 16, in <module>
  File "/usr/lib64/python3.6/ensurepip/_bundled/pip-18.1-py2.py3-none-any.whl/pip/_internal/__init__.py", line 19, in <module>
  File "/usr/lib64/python3.6/ensurepip/_bundled/pip-18.1-py2.py3-none-any.whl/pip/_vendor/urllib3/__init__.py", line 8, in <module>
  File "/usr/lib64/python3.6/ensurepip/_bundled/pip-18.1-py2.py3-none-any.whl/pip/_vendor/urllib3/connectionpool.py", line 11, in <module>
  File "/usr/lib64/python3.6/ensurepip/_bundled/pip-18.1-py2.py3-none-any.whl/pip/_vendor/urllib3/exceptions.py", line 2, in <module>
ModuleNotFoundError: No module named 'pip._vendor.urllib3.packages.six.moves'

fail
Traceback (most recent call last):
  File "/usr/lib/python3.12/site-packages/virtualenv/seed/embed/via_app_data/via_app_data.py", line 83, in _get
    result = get_wheel(
             ^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/virtualenv/seed/wheels/acquire.py", line 27, in get_wheel
    wheel = download_wheel(
            ^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/virtualenv/seed/wheels/acquire.py", line 67, in download_wheel
    raise CalledProcessError(process.returncode, cmd, **kwargs)
subprocess.CalledProcessError: Command '['/usr/bin/python3', '-m', 'pip', 'download', '--progress-bar', 'off', '--disable-pip-version-check', '--only-binary=:all:', '--no-deps', '--python-version', '3.6', '-d', '/root/.local/share/virtualenv/wheel/house', 'pip']' returned non-zero exit status 1.
failed to download pip version bundle, pip download exit code 1
/usr/lib64/python3.6/ensurepip/_bundled/pip-18.1-py2.py3-none-any.whl/pip/_vendor/ipaddress.py:1106: SyntaxWarning: 'str' object is not callable; perhaps you missed a comma?
/usr/lib64/python3.6/ensurepip/_bundled/pip-18.1-py2.py3-none-any.whl/pip/_vendor/ipaddress.py:1106: SyntaxWarning: 'str' object is not callable; perhaps you missed a comma?
Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "/usr/lib64/python3.6/ensurepip/_bundled/pip-18.1-py2.py3-none-any.whl/pip/__main__.py", line 16, in <module>
  File "/usr/lib64/python3.6/ensurepip/_bundled/pip-18.1-py2.py3-none-any.whl/pip/_internal/__init__.py", line 19, in <module>
  File "/usr/lib64/python3.6/ensurepip/_bundled/pip-18.1-py2.py3-none-any.whl/pip/_vendor/urllib3/__init__.py", line 8, in <module>
  File "/usr/lib64/python3.6/ensurepip/_bundled/pip-18.1-py2.py3-none-any.whl/pip/_vendor/urllib3/connectionpool.py", line 11, in <module>
  File "/usr/lib64/python3.6/ensurepip/_bundled/pip-18.1-py2.py3-none-any.whl/pip/_vendor/urllib3/exceptions.py", line 2, in <module>
ModuleNotFoundError: No module named 'pip._vendor.urllib3.packages.six.moves'

fail
Traceback (most recent call last):
  File "/usr/lib/python3.12/site-packages/virtualenv/seed/embed/via_app_data/via_app_data.py", line 83, in _get
    result = get_wheel(
             ^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/virtualenv/seed/wheels/acquire.py", line 27, in get_wheel
    wheel = download_wheel(
            ^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/virtualenv/seed/wheels/acquire.py", line 67, in download_wheel
    raise CalledProcessError(process.returncode, cmd, **kwargs)
subprocess.CalledProcessError: Command '['/usr/bin/python3', '-m', 'pip', 'download', '--progress-bar', 'off', '--disable-pip-version-check', '--only-binary=:all:', '--no-deps', '--python-version', '3.6', '-d', '/root/.local/share/virtualenv/wheel/house', 'setuptools']' returned non-zero exit status 1.
failed to download setuptools version bundle, pip download exit code 1
/usr/lib64/python3.6/ensurepip/_bundled/pip-18.1-py2.py3-none-any.whl/pip/_vendor/ipaddress.py:1106: SyntaxWarning: 'str' object is not callable; perhaps you missed a comma?
/usr/lib64/python3.6/ensurepip/_bundled/pip-18.1-py2.py3-none-any.whl/pip/_vendor/ipaddress.py:1106: SyntaxWarning: 'str' object is not callable; perhaps you missed a comma?
Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "/usr/lib64/python3.6/ensurepip/_bundled/pip-18.1-py2.py3-none-any.whl/pip/__main__.py", line 16, in <module>
  File "/usr/lib64/python3.6/ensurepip/_bundled/pip-18.1-py2.py3-none-any.whl/pip/_internal/__init__.py", line 19, in <module>
  File "/usr/lib64/python3.6/ensurepip/_bundled/pip-18.1-py2.py3-none-any.whl/pip/_vendor/urllib3/__init__.py", line 8, in <module>
  File "/usr/lib64/python3.6/ensurepip/_bundled/pip-18.1-py2.py3-none-any.whl/pip/_vendor/urllib3/connectionpool.py", line 11, in <module>
  File "/usr/lib64/python3.6/ensurepip/_bundled/pip-18.1-py2.py3-none-any.whl/pip/_vendor/urllib3/exceptions.py", line 2, in <module>
ModuleNotFoundError: No module named 'pip._vendor.urllib3.packages.six.moves'

RuntimeError: seed failed due to failing to download wheels wheel, pip, setuptools


Expected results:
As with Python 3.8+:
$ virtualenv --download --python python3.8 venv
created virtual environment CPython3.8.19.final.0-64 in 3663ms
  creator CPython3Posix(dest=/venv, clear=False, no_vcs_ignore=False, global=False)
  seeder FromAppData(extra_search_dir=/usr/share/python-wheels,download=True, pip=bundle, setuptools=bundle, wheel=bundle, via=copy, app_data_dir=/root/.local/share/virtualenv)
    added seed packages: pip==24.0, setuptools==69.2.0, wheel==0.43.0
  activators BashActivator,CShellActivator,FishActivator,NushellActivator,PowerShellActivator,PythonActivator


This likely also breaks tox with the download option: https://tox.wiki/en/latest/config.html#download

Comment 1 Miro Hrončok 2024-04-03 13:26:04 UTC
What is weird is that virtualenv runs code from the pip wheel from 3.6 ensurepip via Python 3.12.

Comment 2 Miro Hrončok 2024-04-03 13:30:28 UTC
Possibly updating the bundled pip wheel in 3.6 to 21.3.1 (the latest 3.6-supporting pip) would make this moot (as it would remove the need for --download for me, but it could also actually make it work).

Comment 3 Miro Hrončok 2024-04-03 13:31:48 UTC
pip 21.3.1 is used by upstream virtualenv 20.21.1:

https://github.com/pypa/virtualenv/blob/20.21.1/src/virtualenv/seed/wheels/embed/__init__.py#L38

Comment 4 Miro Hrončok 2024-04-03 13:33:13 UTC
`virtualenv --download --python python2.7 venv` has the same problem. Upstream virtualenv uses pip 20.3.4, we have /usr/lib64/python2.7/ensurepip/_bundled/pip-19.2.3-py2.py3-none-any.whl

Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "/usr/lib64/python2.7/ensurepip/_bundled/pip-19.2.3-py2.py3-none-any.whl/pip/__main__.py", line 16, in <module>
  File "/usr/lib64/python2.7/ensurepip/_bundled/pip-19.2.3-py2.py3-none-any.whl/pip/_internal/__init__.py", line 19, in <module>
  File "/usr/lib64/python2.7/ensurepip/_bundled/pip-19.2.3-py2.py3-none-any.whl/pip/_vendor/urllib3/__init__.py", line 7, in <module>
  File "/usr/lib64/python2.7/ensurepip/_bundled/pip-19.2.3-py2.py3-none-any.whl/pip/_vendor/urllib3/connectionpool.py", line 11, in <module>
  File "/usr/lib64/python2.7/ensurepip/_bundled/pip-19.2.3-py2.py3-none-any.whl/pip/_vendor/urllib3/exceptions.py", line 2, in <module>
ModuleNotFoundError: No module named 'pip._vendor.urllib3.packages.six.moves'

Comment 5 Miro Hrončok 2024-04-04 15:28:10 UTC
Investigation:

virtualenv upstream actually wants to use the wheel for Python 3.12 (or 3.11 on Fedora 38). However, through this path:

https://github.com/pypa/virtualenv/blob/20.21.1/src/virtualenv/seed/wheels/acquire.py#L23 from_bundle(... for_py_version ...)
https://github.com/pypa/virtualenv/blob/20.21.1/src/virtualenv/seed/wheels/bundle.py#L11 load_embed_wheel(... for_py_version ...)

It goes straight to our patched load_embed_wheel which returns None.

Then it fallbacks to https://github.com/pypa/virtualenv/blob/20.21.1/src/virtualenv/seed/wheels/bundle.py#L46 (for_py_version still set) but it searches in system_wheels_paths created by our patch. Those only include wheels for Python 3.6 (or 2.7).

tl;dr this seems like a downstream bug.

We might need to apply something like this:

https://src.fedoraproject.org/rpms/poetry/blob/c12ecd24/f/Patch-get_embedded_wheel-to-return-system-wheels-fro.patch

Either directly to get_embed_wheel (to replace the poetry patch as well), or to the code in virtualenv that calls it :/

Comment 7 Fedora Update System 2024-04-05 14:26:56 UTC
FEDORA-2024-41abb298ea (python-virtualenv-20.21.1-16.fc41) has been submitted as an update to Fedora 41.
https://bodhi.fedoraproject.org/updates/FEDORA-2024-41abb298ea

Comment 8 Fedora Update System 2024-04-05 14:30:23 UTC
FEDORA-2024-41abb298ea (python-virtualenv-20.21.1-16.fc41) has been pushed to the Fedora 41 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 9 Fedora Update System 2024-04-05 15:05:25 UTC
FEDORA-2024-1f7c112e43 (python-virtualenv-20.21.1-7.fc38) has been submitted as an update to Fedora 38.
https://bodhi.fedoraproject.org/updates/FEDORA-2024-1f7c112e43

Comment 10 Fedora Update System 2024-04-05 15:05:26 UTC
FEDORA-EPEL-2024-6222ef356b (python-virtualenv-20.21.1-7.el9) has been submitted as an update to Fedora EPEL 9.
https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2024-6222ef356b

Comment 11 Fedora Update System 2024-04-05 15:05:27 UTC
FEDORA-2024-8e974e8d80 (python-virtualenv-20.21.1-16.fc40) has been submitted as an update to Fedora 40.
https://bodhi.fedoraproject.org/updates/FEDORA-2024-8e974e8d80

Comment 12 Fedora Update System 2024-04-06 01:04:13 UTC
FEDORA-2024-8e974e8d80 has been pushed to the Fedora 40 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2024-8e974e8d80`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2024-8e974e8d80

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 13 Fedora Update System 2024-04-06 01:10:48 UTC
FEDORA-2024-69367af06c has been pushed to the Fedora 39 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2024-69367af06c`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2024-69367af06c

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 14 Fedora Update System 2024-04-06 01:22:18 UTC
FEDORA-EPEL-2024-6222ef356b has been pushed to the Fedora EPEL 9 testing repository.

You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2024-6222ef356b

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 15 Fedora Update System 2024-04-06 01:59:21 UTC
FEDORA-2024-1f7c112e43 has been pushed to the Fedora 38 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2024-1f7c112e43`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2024-1f7c112e43

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 16 Fedora Update System 2024-04-14 00:40:52 UTC
FEDORA-EPEL-2024-6222ef356b (python-virtualenv-20.21.1-7.el9) has been pushed to the Fedora EPEL 9 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 17 Fedora Update System 2024-04-14 01:36:01 UTC
FEDORA-2024-69367af06c (python-virtualenv-20.21.1-16.fc39) has been pushed to the Fedora 39 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 18 Fedora Update System 2024-04-14 03:08:09 UTC
FEDORA-2024-1f7c112e43 (python-virtualenv-20.21.1-7.fc38) has been pushed to the Fedora 38 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 19 Fedora Update System 2024-04-19 21:30:21 UTC
FEDORA-2024-8e974e8d80 (python-virtualenv-20.21.1-16.fc40) has been pushed to the Fedora 40 stable repository.
If problem still persists, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.