pip: pip breaks after installation of some packages

Description

pip dies

Expected behavior

pip does not die

pip version

unsure, cannot run pip

Python version

python 3.5.10

OS

Arch

How to Reproduce

not sure

Output

pip                                     ✔   
Traceback (most recent call last):
  File "/usr/bin/pip", line 5, in <module>
    from pip._internal.cli.main import main
  File "/usr/lib/python3.10/site-packages/pip/_internal/cli/main.py", line 9, in <module>
    from pip._internal.cli.autocompletion import autocomplete
  File "/usr/lib/python3.10/site-packages/pip/_internal/cli/autocompletion.py", line 10, in <module>
    from pip._internal.cli.main_parser import create_main_parser
  File "/usr/lib/python3.10/site-packages/pip/_internal/cli/main_parser.py", line 8, in <module>
    from pip._internal.cli import cmdoptions
  File "/usr/lib/python3.10/site-packages/pip/_internal/cli/cmdoptions.py", line 29, in <module>
    from pip._internal.models.target_python import TargetPython
  File "/usr/lib/python3.10/site-packages/pip/_internal/models/target_python.py", line 6, in <module>
    from pip._internal.utils.compatibility_tags import get_supported, version_info_to_nodot
  File "/usr/lib/python3.10/site-packages/pip/_internal/utils/compatibility_tags.py", line 7, in <module>
    from pip._vendor.packaging.tags import (
ImportError: cannot import name 'PythonVersion' from 'pip._vendor.packaging.tags' (/home/france1/.local/lib/python3.10/site-packages/packaging/tags.py)


### Code of Conduct

- [X] I agree to follow the [PSF Code of Conduct](https://www.python.org/psf/conduct/).

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 17 (12 by maintainers)

Commits related to this issue

Most upvoted comments

Thanks @dvzrv! ❤️

A possible way to solve this without affecting the users too much would be for arch to create a custom scheme for arch-provided packages and have pip only look at that. However, this is currently not possible due because the proposed mechanism that would allow us to implement this haven’t been merged in CPython and arch has a policy against patching. Maybe a exception can be made here, but I am not sure, the CPython upstream did already acknowledge these kind of needs with https://docs.python.org/3/library/sysconfig.html#sysconfig._get_preferred_schemes, and the discussion around the proposed mechanisms isn’t either if they are a bad thing/solution, but rather than if they are enough for other distributions, specifically Debian. If it helps, we can coordinate with the Python upstream in this.

That said, I am not the python or python-pip maintainer, so this is not my call to make. I only really see two options to solve this, either 1) remove the devendoring in python-pip, as the vendoring is a specifically designed mechanism with a purpose other than just simplify bootstrapping, or 2) add an addition install scheme and have pip only pip up that one, as I described above.

I understand this all is very complex, please let me know if there is anything you’d like me to clarify.