Pip hangs after running any command (aside from --version, which is the only one that has worked for me)
See original GitHub issueEnvironment
- pip version: 20.0.2
- Python version: 3.8
- Operating system: Ubuntu 20.04 running on WSL2
Description
Running any pip command (except pip --version) seems to cause it to hang until keyboard interrupt
Expected behavior
The command typed is meant to be executed
How to Reproduce
Note: I linked pip3 to run with the alias pip since I uninstalled python 2.7
- Get a fresh install of pip3 from ‘sudo apt install python3-pip’
- Try to run any command aside from --version
- terminal hangs
Output I am forced to keyboard interrupt
pip search asd
^CTraceback (most recent call last):
File "/usr/bin/pip", line 11, in <module>
load_entry_point('pip==20.0.2', 'console_scripts', 'pip3')()
File "/usr/lib/python3/dist-packages/pip/_internal/cli/main.py", line 73, in main
command = create_command(cmd_name, isolated=("--isolated" in cmd_args))
File "/usr/lib/python3/dist-packages/pip/_internal/commands/__init__.py", line 96, in create_command
module = importlib.import_module(module_path)
File "/usr/lib/python3.8/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
File "<frozen importlib._bootstrap>", line 991, in _find_and_load
File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 783, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "/usr/lib/python3/dist-packages/pip/_internal/commands/search.py", line 18, in <module>
from pip._internal.cli.req_command import SessionCommandMixin
File "/usr/lib/python3/dist-packages/pip/_internal/cli/req_command.py", line 19, in <module>
from pip._internal.network.session import PipSession
File "/usr/lib/python3/dist-packages/pip/_internal/network/session.py", line 26, in <module>
from pip._internal.network.auth import MultiDomainBasicAuth
File "/usr/lib/python3/dist-packages/pip/_internal/network/auth.py", line 36, in <module>
import keyring # noqa
File "/usr/lib/python3/dist-packages/keyring/__init__.py", line 3, in <module>
from .core import (
File "/usr/lib/python3/dist-packages/keyring/core.py", line 189, in <module>
init_backend()
File "/usr/lib/python3/dist-packages/keyring/core.py", line 93, in init_backend
keyrings = filter(limit, backend.get_all_keyring())
File "/usr/lib/python3/dist-packages/keyring/util/__init__.py", line 21, in wrapper
func.always_returns = func(*args, **kwargs)
File "/usr/lib/python3/dist-packages/keyring/backend.py", line 210, in get_all_keyring
return list(rings)
File "/usr/lib/python3/dist-packages/keyring/util/__init__.py", line 31, in suppress_exceptions
for callable in callables:
File "/usr/lib/python3/dist-packages/keyring/util/properties.py", line 26, in __get__
return self.fget.__get__(None, owner)()
File "/usr/lib/python3/dist-packages/keyring/backend.py", line 67, in viable
cls.priority
File "/usr/lib/python3/dist-packages/keyring/util/properties.py", line 26, in __get__
return self.fget.__get__(None, owner)()
File "/usr/lib/python3/dist-packages/keyring/backends/kwallet.py", line 37, in priority
bus = dbus.SessionBus(mainloop=DBusGMainLoop())
File "/usr/lib/python3/dist-packages/dbus/_dbus.py", line 212, in __new__
return Bus.__new__(cls, Bus.TYPE_SESSION, private=private,
File "/usr/lib/python3/dist-packages/dbus/_dbus.py", line 102, in __new__
bus = BusConnection.__new__(subclass, bus_type, mainloop=mainloop)
File "/usr/lib/python3/dist-packages/dbus/bus.py", line 124, in __new__
bus = cls._new_for_bus(address_or_type, mainloop=mainloop)
File "/usr/lib/python3/dist-packages/dbus/exceptions.py", line 47, in __init__
def __init__(self, *args, **kwargs):
KeyboardInterrupt
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (1 by maintainers)
Top Results From Across the Web
Pip Install hangs - python - Stack Overflow
I'm trying to install a Python package using the command "pip install" but as soon as I hit enter nothing happens. The action...
Read more >pip install hangs : Forums - PythonAnywhere
In a fresh Bash console, I am trying to use the command. pip install --user Django==3.1.9. This results in · That's really strange!...
Read more >Troubleshooting | PyCharm Documentation - JetBrains
A version of the package installed for a particular Python interpreter is outdated. Run the following commands to install the required package:.
Read more >Create Your requirements.txt Using This Technique
txt file is to run pip freeze > requirements.txt when all packages are already installed. However, the problem with such an approach is...
Read more >Installing Python requirements with an extra index url hangs ...
This used to work, but now hangs when installing dependencies. I tried updating pip, and using pip3. I have modified the requirements.txt to...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

This was exactly it for me! I was trying to get tkinter to work in wsl and updated the DISPLAY variable. I never did get it working but forgot to remove my change. I just commented it out and pip is working again. Thanks a bunch!