Tests successfully for me, although I have to clear the virtualenv
cached eggs with --clear-app-data.

We could upload virtualenv to bump the version again, like
https://launchpad.net/ubuntu/+source/python-
virtualenv/20.0.17-1ubuntu0.3 to make this automatic, and avoid users
who have hit the bug, needing to --clear-app-data, to resolve it.

** Description changed:

  [Impact]
  
-  * pypy and pypy3 virtualenvs created with virtualenv have an unuseable
+  * pypy and pypy3 virtualenvs created with virtualenv have an unuseable
  pip.
  
  [Test Plan]
  
  # apt install pypy virtualenv
- $ virtualenv -p pypy testve
+ $ virtualenv -p pypy testve --clear-app-data
  $ testve/bin/python -m pip
  
  Failure:
  A traceback ending in:
  ModuleNotFoundError: No module named 'pip._vendor.six'
  
  Success:
  --help output
  
  [Where problems could occur]
  
-  * This change has been carried in Debian and Ubuntu since 20.1-2, so
+  * 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.cli.main import main
    File "/venv/site-packages/pip/_internal/cli/main.py", line 10, in <module>
      from pip._internal.cli.autocompletion import autocomplete
    File "/venv/site-packages/pip/_internal/cli/autocompletion.py", line 9, in 
<module>
      from pip._internal.cli.main_parser import create_main_parser
    File "/venv/site-packages/pip/_internal/cli/main_parser.py", line 7, in 
<module>
      from pip._internal.cli import cmdoptions
    File "/venv/site-packages/pip/_internal/cli/cmdoptions.py", line 24, in 
<module>
      from pip._internal.exceptions import CommandError
    File "/venv/site-packages/pip/_internal/exceptions.py", line 10, in <module>
      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://pip.pypa.io/en/latest/development/release-process/#python-2-support pip 
21.0 will remove support for this functionality.
  Collecting requests
    Downloading requests-2.25.1-py2.py3-none-any.whl (61 kB)
       |################################| 61 kB 8.8 MB/s
  Collecting chardet<5,>=3.0.2
    Downloading chardet-4.0.0-py2.py3-none-any.whl (178 kB)
       |################################| 178 kB 26.8 MB/s
  Collecting idna<3,>=2.5
    Downloading idna-2.10-py2.py3-none-any.whl (58 kB)
       |################################| 58 kB 9.8 MB/s
  Collecting urllib3<1.27,>=1.21.1
    Downloading urllib3-1.26.6-py2.py3-none-any.whl (138 kB)
       |################################| 138 kB 43.6 MB/s
  Collecting certifi>=2017.4.17
    Downloading certifi-2021.5.30-py2.py3-none-any.whl (145 kB)
       |################################| 145 kB 48.1 MB/s
  Installing collected packages: chardet, idna, urllib3, certifi, requests
  ERROR: Exception:
  Traceback (most recent call last):
    File "/venv/site-packages/pip/_internal/cli/base_command.py", line 223, in 
_main
      status = self.run(options, args)
    File "/venv/site-packages/pip/_internal/cli/req_command.py", line 180, in 
wrapper
      return func(self, options, args)
    File "/venv/site-packages/pip/_internal/commands/install.py", line 404, in 
run
      pycompile=options.compile,
    File "/venv/site-packages/pip/_internal/req/__init__.py", line 90, in 
install_given_reqs
      pycompile=pycompile,
    File "/venv/site-packages/pip/_internal/req/req_install.py", line 824, in 
install
      requested=self.user_supplied,
    File "/venv/site-packages/pip/_internal/operations/install/wheel.py", line 
845, in install_wheel
      requested=requested,
    File "/venv/site-packages/pip/_internal/operations/install/wheel.py", line 
719, in _install_wheel
      assert os.path.exists(pyc_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

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1935882

Title:
  pypy virtualenv has broken pip on focal

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/python-pip/+bug/1935882/+subscriptions


-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to