Pip: Pip3: ImportError: cannot import name 'compatible_tags'...

Created on 18 May 2020  路  8Comments  路  Source: pypa/pip

  • pip version: 20.0.2-1
  • Python version: 3.8.2
  • Operating system: ArchLinux

Running pip3 always fails and dumps an error:

Traceback (most recent call last):
  File "/usr/bin/pip3", line 11, in <module>
    load_entry_point('pip==20.0.2', 'console_scripts', 'pip3')()
  File "/usr/lib/python3.8/site-packages/pkg_resources/__init__.py", line 490, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/usr/lib/python3.8/site-packages/pkg_resources/__init__.py", line 2862, in load_entry_point
    return ep.load()
  File "/usr/lib/python3.8/site-packages/pkg_resources/__init__.py", line 2453, in load
    return self.resolve()
  File "/usr/lib/python3.8/site-packages/pkg_resources/__init__.py", line 2459, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
  File "/usr/lib/python3.8/site-packages/pip/_internal/cli/main.py", line 10, in <module>
    from pip._internal.cli.autocompletion import autocomplete
  File "/usr/lib/python3.8/site-packages/pip/_internal/cli/autocompletion.py", line 9, in <module>
    from pip._internal.cli.main_parser import create_main_parser
  File "/usr/lib/python3.8/site-packages/pip/_internal/cli/main_parser.py", line 7, in <module>
    from pip._internal.cli import cmdoptions
  File "/usr/lib/python3.8/site-packages/pip/_internal/cli/cmdoptions.py", line 28, in <module>
    from pip._internal.models.target_python import TargetPython
  File "/usr/lib/python3.8/site-packages/pip/_internal/models/target_python.py", line 3, in <module>
    from pip._internal.pep425tags import get_supported, version_info_to_nodot
  File "/usr/lib/python3.8/site-packages/pip/_internal/pep425tags.py", line 7, in <module>
    from pip._vendor.packaging.tags import (
ImportError: cannot import name 'compatible_tags' from 'pip._vendor.packaging.tags' (/usr/lib/python3.8/site-packages/packaging/tags.py)
downstream

Most helpful comment

I've installed pip using the get-pip.py script, and this issue was gone.

All 8 comments

Could you also try with the latest version of pip 20.1, and see if the error still remains?

Also after upgrading to pip, could you also post the output for which pip, and which pip3 as well.

@deveshks

The issue has gone in pip 20.1.

This is almost certainly related to how ArchLinux is packaging pip / CPython. It might be a good idea to raise this on their communication channels/issue tracker.

No, @pradyunsg , not related to Arch.

I also faced this issue on Ubuntu, and the pip is installed via older pip (pip install -U pip).

I've installed pip using the get-pip.py script, and this issue was gone.

Thanks @Qualphey for the information! That makes it clearer that it's due to a distro patch, and not (at least in isolation) an upstream pip bug.

No, @pradyunsg , not related to Arch.

I'm certain that it is. :)

The only way to get a version number like 20.0.2-1 is through the distro's packages. It's more likely that both Debian and Arch have a similar gap in their patched version of pip, as part of their process of debundling pip's _vendor directory.

I've installed pip using the get-pip.py script, and this issue was gone.

That's good to hear @Qualphey . I think you can go ahead and close this issue if the problem is resolved.

I've installed pip using the get-pip.py script, and this issue was gone.

This worked for me on Ubuntu 20.04. Thanks a lot.

Was this page helpful?
0 / 5 - 0 ratings