11

I'm trying to install pandas but I'm getting this error:

Collecting pandas

Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ReadTimeoutError("HTTPSConnectionPool(host='files.pythonhosted.org', port=443): Read timed out. (read timeout=15)")': /packages/26/fc/d0509d445d2724fbc5f9c9a6fc9ce7da794873469739b6c94afc166ac2a2/pandas-0.23.4-cp37-cp37m-win32.whl 
Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ReadTimeoutError("HTTPSConnectionPool(host='files.pythonhosted.org', port=443): Read timed out. (read timeout=15)")': /packages/26/fc/d0509d445d2724fbc5f9c9a6fc9ce7da794873469739b6c94afc166ac2a2/pandas-0.23.4-cp37-cp37m-win32.whl 
Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ReadTimeoutError("HTTPSConnectionPool(host='files.pythonhosted.org', port=443): Read timed out. (read timeout=15)")': /packages/26/fc/d0509d445d2724fbc5f9c9a6fc9ce7da794873469739b6c94afc166ac2a2/pandas-0.23.4-cp37-cp37m-win32.whl 
Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ReadTimeoutError("HTTPSConnectionPool(host='files.pythonhosted.org', port=443): Read timed out. (read timeout=15)")': /packages/26/fc/d0509d445d2724fbc5f9c9a6fc9ce7da794873469739b6c94afc166ac2a2/pandas-0.23.4-cp37-cp37m-win32.whl 
Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ReadTimeoutError("HTTPSConnectionPool(host='files.pythonhosted.org', port=443): Read timed out. (read timeout=15)")': /packages/26/fc/d0509d445d2724fbc5f9c9a6fc9ce7da794873469739b6c94afc166ac2a2/pandas-0.23.4-cp37-cp37m-win32.whl 
Could not install packages due to an EnvironmentError: HTTPSConnectionPool(host='files.pythonhosted.org', port=443): Max retries exceeded with url: /packages/26/fc/d0509d445d2724fbc5f9c9a6fc9ce7da794873469739b6c94afc166ac2a2/pandas-0.23.4-cp37-cp37m-win32.whl (Caused by ReadTimeoutError("HTTPSConnectionPool(host='files.pythonhosted.org', port=443): Read timed out. (read timeout=15)"))

I am running on the command prompt as an admin and I am typing in pip install pandas. I have pip version 18.1. I have also tried running this on the Windows PowerShell within the scripts directory for python.

I have never had an issue installing a package before.

What is the error caused by and how do I fix it?

Gino Mempin
  • 25,369
  • 29
  • 96
  • 135
JackU
  • 1,406
  • 3
  • 15
  • 43

5 Answers5

13

Looks like you're trying to install on a corporate network with a firewall in place, can you connect to another WiFi or hot spot and try downloading again?

EcSync
  • 842
  • 1
  • 6
  • 20
7

It seems that you have slow connection to the server. Try increasing the timeout:

sudo pip install --default-timeout=120 pandas

Alternatively, you may use:

export PIP_DEFAULT_TIMEOUT=120

This is the amount of time (in seconds) pip will wait before deciding that the connection timed out (now it's 15 seconds in your case - "read timeout=15")

  • I've just given this a go and I get exactly the same error. I have also tried to change networks and this has worked either. – JackU Jan 10 '19 at 08:58
  • Can you reach the server at all? Try to open https://files.pythonhosted.org/ from a web browser. – Lukasz Korbasiewicz Jan 10 '19 at 09:00
  • I can't reach the server, the connection times out. Is this likely to be my side or their side? – JackU Jan 10 '19 at 09:03
  • Your side I would say, or somewhere between you and them (your ISP?). I can reach them – Lukasz Korbasiewicz Jan 10 '19 at 09:13
  • I am having the same issue i had connected to my companys vpn and now I am getting the same error , i have added global trusted sites and also tried adding trusted in the command but none of them seems to work – goose Apr 16 '20 at 04:49
  • I tried eveyrhing but Interestingly "export PIP_DEFAULT_TIMEOUT=120" solved the issue – Neeraj Gulia May 11 '20 at 12:01
4

If you are logged as Administrator user and still facing this issue. There could be three reasons:

  1. Your machine/company's firewall is not allowing you to install/upgrade any module. (Contact support department).
  2. The WiFi is slow. (Fix is mentioned by other users).
  3. Sounds silly but most common reason, you have not rebooted the machine after installing Python on the guest.(Try rebooting).

Let me know if it helped you or anyone reading this comment.

Nishant Mor
  • 151
  • 9
0

FIXED --> ERROR: Could not install packages due to an OSError: HTTPSConnectionPool(host='files.pythonhosted.org', port=443): Max retries exceeded with url: <...> (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:997)'))) Steps:

  1. Disconnect from VPN client
  2. Re-issue CMD command> pip install robotframework ... Successfully installed pip-21.3.1
  • As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Nov 23 '21 at 06:37
0

Configure pip to trust the files.pythonhosted.org host:

pip config set --user global.trusted-host files.pythonhosted.org

You should then be able to perform the install.

Travis
  • 2,135
  • 17
  • 29