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.

KeyError: 'pip._vendor.urllib3.util.queue' on any pip command

See original GitHub issue

Environment

  • pip version: 10.0.1
  • Python version: 3.6
  • OS: Manjaro Linux

Description On any pip command, even on simply calling pip --help I get this:

Traceback (most recent call last):
  File "/usr/bin/pip", line 11, in <module>
    load_entry_point('pip==10.0.1', 'console_scripts', 'pip')()
  File "/usr/lib/python3.6/site-packages/pkg_resources/__init__.py", line 476, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/usr/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2700, in load_entry_point
    return ep.load()
  File "/usr/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2318, in load
    return self.resolve()
  File "/usr/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2324, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
  File "/usr/lib/python3.6/site-packages/pip/_internal/__init__.py", line 20, in <module>
    from pip._vendor.urllib3.exceptions import DependencyWarning
  File "/usr/lib/python3.6/site-packages/pip/_vendor/__init__.py", line 82, in <module>
    vendored("requests.packages")
  File "/usr/lib/python3.6/site-packages/pip/_vendor/__init__.py", line 33, in vendored
    __import__(vendored_name, globals(), locals(), level=0)
  File "/usr/lib/python3.6/site-packages/pip/_vendor/requests/packages.py", line 12, in <module>
    sys.modules['pip._vendor.requests.packages.' + mod] = sys.modules["pip._vendor." + mod]
KeyError: 'pip._vendor.urllib3.util.queue'

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

5reactions
Artaluscommented, Jun 21, 2018

Yes, it appears to be some sort of distro-based problem. Simply reinstalling pip didn’t help, but

rm -r /usr/lib/python3.6/site-packages/pip;
pacman -S python-pip --force

solved it for me. Got the idea from those two reports [1] [2].

0reactions
user506commented, May 9, 2019

Traceback (most recent call last): File “/usr/lib/python3/dist-packages/pip/_vendor/init.py”, line 33, in vendored import(vendored_name, globals(), locals(), level=0) ImportError: No module named ‘pip._vendor.pkg_resources’

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File “/usr/lib/python3.5/runpy.py”, line 174, in _run_module_as_main mod_name, mod_spec, code = _get_module_details(mod_name, _Error) File “/usr/lib/python3.5/runpy.py”, line 133, in _get_module_details return _get_module_details(pkg_main_name, error) File “/usr/lib/python3.5/runpy.py”, line 109, in _get_module_details import(pkg_name) File “/usr/lib/python3/dist-packages/pip/init.py”, line 13, in <module> from pip.exceptions import InstallationError, CommandError, PipError File “/usr/lib/python3/dist-packages/pip/exceptions.py”, line 6, in <module> from pip._vendor.six import iteritems File “/usr/lib/python3/dist-packages/pip/_vendor/init.py”, line 75, in <module> vendored(“pkg_resources”) File “/usr/lib/python3/dist-packages/pip/_vendor/init.py”, line 36, in vendored import(modulename, globals(), locals(), level=0) File “<frozen importlib._bootstrap>”, line 969, in _find_and_load File “<frozen importlib._bootstrap>”, line 958, in _find_and_load_unlocked File “<frozen importlib._bootstrap>”, line 664, in _load_unlocked File “<frozen importlib._bootstrap>”, line 634, in _load_backward_compatible File “/usr/share/python-wheels/pkg_resources-0.0.0-py2.py3-none-any.whl/pkg_resources/init.py”, line 2927, in <module> File “/usr/share/python-wheels/pkg_resources-0.0.0-py2.py3-none-any.whl/pkg_resources/init.py”, line 2913, in _call_aside File “/usr/share/python-wheels/pkg_resources-0.0.0-py2.py3-none-any.whl/pkg_resources/init.py”, line 2952, in _initialize_master_working_set File “/usr/share/python-wheels/pkg_resources-0.0.0-py2.py3-none-any.whl/pkg_resources/init.py”, line 956, in subscribe File “/usr/share/python-wheels/pkg_resources-0.0.0-py2.py3-none-any.whl/pkg_resources/init.py”, line 2952, in <lambda> File “/usr/share/python-wheels/pkg_resources-0.0.0-py2.py3-none-any.whl/pkg_resources/init.py”, line 2515, in activate File “/usr/share/python-wheels/pkg_resources-0.0.0-py2.py3-none-any.whl/pkg_resources/init.py”, line 2097, in declare_namespace File “/usr/share/python-wheels/pkg_resources-0.0.0-py2.py3-none-any.whl/pkg_resources/init.py”, line 2047, in _handle_ns File “/usr/share/python-wheels/pkg_resources-0.0.0-py2.py3-none-any.whl/pkg_resources/init.py”, line 2066, in _rebuild_mod_path AttributeError: ‘_NamespacePath’ object has no attribute ‘sort’

help me in this

Read more comments on GitHub >

github_iconTop Results From Across the Web

Heroku python app throwing error - KeyError: 'pip._vendor ...
switching from from pip._vendor import requests to import requests solved this issue for me. If it doesnt solve it for you, you should...
Read more >
Download Patch File - CAMP
requests/packages/urllib3/util/timeout.py | 242 + .../requests/packages/urllib3/util/url.py | 217 + .../pip/_vendor/requests/sessions.py | 712 +++ .
Read more >
PSA: pip 9.0.2 broken (KeyError: 'pip._vendor.urllib3 ... - Reddit
It's only broken if you import internal functions from pip not if you use it via the cli. It's long been documented that...
Read more >
mozilla-central: changeset 607536 ...
IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF...
Read more >
Release 5.0.1 David Cortesi - PyInstaller Documentation
pip install -U pyinstaller. Open a command prompt/shell window, and navigate to the directory where your .py file is located, ...
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