Trying to install packages for python in Windows 10 machine and python 3.7.2. I'm using the following command:
pip install numpy
And it hangs forever. I tried to get more information using the following:
pip -vvv install numpy
and here's the result:
Collecting numpy
1 location(s) to search for versions of numpy:
* https://pypi.org/simple/numpy/
Getting page https://pypi.org/simple/numpy/
Looking up "https://pypi.org/simple/numpy/" in the cache
Request header has "max_age" as 0, cache bypassed
Starting new HTTPS connection (1): pypi.org:443
https://pypi.org:443 "GET /simple/numpy/ HTTP/1.1" 304 0
I tried to research it but can't find anything. I can't believe only this package would go through HTTPS and that's why it's failing?
I had the same issue with Django.
The diff in the output of both commands is the following:
pip install Django -vvv
...
Looking up "https://pypi.org/simple/django/" in the cache
Request header has "max_age" as 0, cache bypassed
https://pypi.org:443 "GET /simple/django/ HTTP/1.1" 304 0
<hangs here>
$ pip install Django --no-cache-dir -vvv
...
https://pypi.org:443 "GET /simple/django/ HTTP/1.1" 200 27460
<continues and successfully installs>
Using --no-cache-dir
just bypasses the problem.
The solution came when I manually deleted the contents of the cache directory.
rm -Rf ~/.cache/pip/*
allowed pip install Django
to work as expected, and the cache started rebuilding itself again.
From the docs you can find the path where the cache lives, based on your os:
The default location for the cache directory depends on the Operating System:
Unix
~/.cache/pip and it respects the XDG_CACHE_HOME directory
.macOS
~/Library/Caches/pip
.Windows
<CSIDL_LOCAL_APPDATA>\pip\Cache
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With