question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

pip breaks after installation of some packages

See original GitHub issue

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/).

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:17 (12 by maintainers)

github_iconTop GitHub Comments

1reaction
pradyunsgcommented, Aug 30, 2022

Thanks @dvzrv! ❤️

1reaction
FFY00commented, Aug 27, 2022

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

pip install breaks existing install (and prints that it did ... - GitHub
When running pip install with packages that are incompatible, pip breaks the existing install instead of refusing the action.
Read more >
how to fix a broken pip install? [duplicate] - Stack Overflow
It will install all required packages, such as wheel and pip . To check if it was installed correctly, type pip --version in...
Read more >
pip install - pip documentation v22.3.1
Ignore the installed packages, overwriting them. This can break your system if the existing package is of a different version or was installed...
Read more >
Using Python's pip to Manage Your Projects' Dependencies
Any pip commands that you perform from now on will happen inside your virtual environment. To install packages, pip provides an install command....
Read more >
How to Update All Python Packages - ActiveState
Update all Python Packages on Windows · Open a command shell by typing 'powershell' in the Search Box of the Task bar ·...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found