pypy virtualenv has broken pip on focal
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
python-pip (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned | ||
Focal |
Fix Released
|
Medium
|
Unassigned | ||
python-virtualenv (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned | ||
Focal |
New
|
Undecided
|
Unassigned |
Bug Description
[Impact]
* pypy and pypy3 virtualenvs created with virtualenv have an unuseable pip.
[Test Plan]
# apt install pypy virtualenv
$ virtualenv -p pypy testve --clear-app-data
$ testve/bin/python -m pip
Failure:
A traceback ending in:
ModuleNotFoundE
Success:
--help output
[Where problems could occur]
* This change has been carried in Debian and Ubuntu since 20.1-2, so it's well tested. It's very simple, and should have been included in the Bug #1904945 SRU
[Original Bug report]
I reproduced this in a docker image (ubuntu:20.04)
Reproduction steps:
1) install `virtualenv` and `pypy`
2) run `virtualenv --python pypy venv`
3) run `venv/bin/pip`
This fails with this error output:
Traceback (most recent call last):
File "venv/bin/pip", line 5, in <module>
from pip._internal.
File "/venv/
from pip._internal.
File "/venv/
from pip._internal.
File "/venv/
from pip._internal.cli import cmdoptions
File "/venv/
from pip._internal.
File "/venv/
from pip._vendor.six import iteritems
ImportError: No module named pip._vendor.six
This should have printed out the usage information for pip.
I tried working around this by running `virtualenv --python pypy --download venv`. This allows running just `venv/bin/pip` to succeed, but a typical real usage of it fails like this:
# venv/bin/pip install requests
DEPRECATION: pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https:/
Collecting requests
Downloading requests-
|#
Collecting chardet<5,>=3.0.2
Downloading chardet-
|#
Collecting idna<3,>=2.5
Downloading idna-2.
|#
Collecting urllib3<
Downloading urllib3-
|#
Collecting certifi>=2017.4.17
Downloading certifi-
|#
Installing collected packages: chardet, idna, urllib3, certifi, requests
ERROR: Exception:
Traceback (most recent call last):
File "/venv/
status = self.run(options, args)
File "/venv/
return func(self, options, args)
File "/venv/
pycompile=
File "/venv/
pycompile=
File "/venv/
requested=
File "/venv/
requested=
File "/venv/
assert os.path.
AssertionError
This should have installed the requests package, instead of failing.
It's worth noting this seems to work with cpython. I specifically tried with python2.7 and the default python3 (python3.8). Using pypy3 fails in the same way.
Release info:
# lsb_release -rd
Description: Ubuntu 20.04.2 LTS
Release: 20.04
description: | updated |
tags: |
added: verification-done removed: verification-needed |
This was fixed in https:/ /salsa. debian. org/python- team/packages/ python- pip/-/commit/ 752d2a38f88d5c8 0b6d93ce9199205 7f5c75cafc
I should have included that in 20.0.2-5ubuntu1.2