Pip Install hangs

@JBernardo 's comment worked for me. Thanks!

python -m pip install some_package_you_want

If you're using Ubuntu via WSL2 on Windows, it might not work outside a virtualenv. python3 -v -m pip install ... showed me that it was hanging on some OS X keychain import... Hopefully this helps someone else.


If you are you using WSL2, indeed it could be related to pip trying to connect to an XServer. If so, clearing the DISPLAY environment variable first before running it may help:

export DISPLAY=
pip install <packagename>

(Or, as a one-liner: DISPLAY= pip install <packagename>)