0

My institution runs a filter that makes less safe sites inaccessible. One site that I can reach just fine using a browser is

https://pypi.python.org/simple/waitress/

and yet if I run pip -vvv install waitress (the problem occurs with all packages, not just waitress) from an Anaconda command prompt I get:

Could not fetch URL https://pypi.python.org/simple/waitress/:
connection error: HTTPSConnectionPool(host='pypi.python.org', port=443):
Max retries exceeded with url: /simple/waitress/ (Caused by
NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection
object at 0x00000000050FD400>:
Failed to establish a new connection: [WinError 10061]
No connection could be made because the target machine
actively refused it',)) - skipping

I can request to selectively open the necessary URLs, but in this case it appears that port 443 at pypi.python.org is already open.

Can you explain this puzzle? Why is pip unable to reach a site that a browser (on the same machine) can reach?

Vrokipal
  • 676
  • 5
  • 16
  • 1
    Maybe the browser was configured to access port 443 via a proxy? – Óscar López Sep 18 '18 at 14:30
  • I had the same problem. To get around this I started using Anaconda, which was luckily not blocked. From then on i used `conda install ` then used that Virtual env to run my projects. Add multiple channels to your anaconda so you can find your package somewhere. – Vineeth Sai Sep 18 '18 at 14:34
  • @VineethSai `conda install waitress` gives me "CondaHTTPError: HTTP 000 CONNECTION FAILED". – Vrokipal Sep 18 '18 at 14:44
  • @ÓscarLópez Okay... how do I get pip to send the request to the same proxy? – Vrokipal Sep 18 '18 at 14:45
  • If waitress doesn't have many dependencies maybe you can download the package manually and install using setup.py. As you said your browser was able to access it, It should be able to download too. – Vineeth Sai Sep 18 '18 at 14:45
  • @VineethSai How do you uncover this DAG of installations? "Using setup.py": Do you mean unpack manually and run the "setup.py" that is part of the package? – Vrokipal Sep 18 '18 at 14:51
  • Check this post: https://stackoverflow.com/questions/14149422/using-pip-behind-a-proxy – Óscar López Sep 18 '18 at 14:58

1 Answers1

0

This a simple solution using ssl, since the release of pip 10.0, you should be able to fix this permanently just by upgrading pip itself:

pip install --trusted-host pypi.org --trusted-host files.pythonhosted.org pip waitress

Let me know if works

Marco Visibelli
  • 161
  • 1
  • 6
  • That's still blocked. My pip (from a recent anaconda) is 9.0.1. I tried "pip install --trusted-host pypi.org --trusted-host files.pythonhosted.org --upgrade pip" but that's not more successful. – Vrokipal Sep 18 '18 at 15:43
  • can you tell me what is the output? – Marco Visibelli Sep 18 '18 at 18:35