1

I'm trying to begin using Python 3.6 on a Windows 10 Enterprise but whenever I try to use pip to install necessary packages I always get a similar SSL error.

pip install requests gives the following error:

Collecting requests
  Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:833)'),)': /simple/requests/
  Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:833)'),)': /simple/requests/
  Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:833)'),)': /simple/requests/
  Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:833)'),)': /simple/requests/
  Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:833)'),)': /simple/requests/
  Could not fetch URL https://pypi.python.org/simple/requests/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.python.org', port=443): Max retries exceeded with url: /simple/requests/ (Caused by SSLError(SSLError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:833)'),)) - skipping
  Could not find a version that satisfies the requirement requests (from versions: )
No matching distribution found for requests

I got this similar pattern of "Retrying" and failing error for all pip packages I try to install. I tried doing "easy_install bioservices" and I got:

...

Installed c:\users\...\python\python36-32\lib\site-packages\requests_cache-0.4.13-py3.6.egg
error: The 'requests' distribution was not found and is required by bioservices

And then trying to do pip install bioservices gives me:

Requirement already satisfied: bioservices in c:\users...\python\python36-32\lib\site-packages\bioservices-1.5.2-py3.6.egg Collecting grequests (from bioservices) Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:833)'),)': /simple/grequests/
Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:833)'),)': /simple/grequests/ Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:833)'),)': /simple/grequests/
Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:833)'),)': /simple/grequests/ Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:833)'),)': /simple/grequests/
Could not fetch URL https://pypi.python.org/simple/grequests/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.python.org', port=443): Max retries exceeded with url: /simple/grequests/ (Caused by SSLError(SSLError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:833)'),)) - skipping Could not find a version that satisfies the requirement grequests (from bioservices) (from versions: ) No matching distribution found for grequests (from bioservices)


I have no idea how to fix this. I'm using python 3.6.5 and pip 9.0.3. I've tried looking through many different stack overflow questions and other forums and have had no luck

Nisarg
  • 1,631
  • 6
  • 19
  • 31
user90823745
  • 149
  • 1
  • 2
  • 15
  • You need to upgrade your `pip` to at least 10.0.1 (also `setuptools` to at least… I think 30.0.0, but I'm not sure). You can do this by reinstalling them from scratch, or, more simply, by running `pip install --trusted-host pypi.org --trusted-host files.pythonhosted.org --upgrade pip setuptools`. – abarnert Aug 06 '18 at 20:18
  • I'm pretty sure there's a good dup explaining this, which I'll track down. Meanwhile, see [this question](https://stackoverflow.com/questions/25981703/) for other ways of suppressing the SSL error while upgrading `pip` and `setuptools`. Whichever one you use is fine; once `pip` is updated, you shouldn't need to do anything ever again. But the line from my first comment should do it for you. – abarnert Aug 06 '18 at 20:20
  • I couldn't find a duplicate that was up-to-date, but nearly as good as that one, so I updated the answer on that one… – abarnert Aug 06 '18 at 20:26
  • @abarnert Running your first comment still gives me the same pattern of retry errors and sslerror as all pip commands have been :( I also saw that article as well and tried the easy_install method (described in my post) – user90823745 Aug 06 '18 at 20:27
  • Don't try `easy_install`; that advice is very out of date. You really do need to upgrade your `pip`, either the way I showed above, or by just reinstalling it with `get-pip.py` (also shown in the same linked answer). After you do that, if you still have the same errors, you can edit your question to be about pip 18 and setuptools 40 instead of the old versions, and we can debug it from there. (Whether that means finding a dup that fixes your problem, or writing a new answer.) – abarnert Aug 06 '18 at 20:30
  • @abarnert I get another SSL cert error (curl: (60) SSL certificate problem: self signed certificate in certificate chain) trying to use the curl statement in the link for reinstalling pip - curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py – user90823745 Aug 06 '18 at 20:46
  • If both `pip` and `curl` are having problems, it sounds like you're behind some proxy that's breaking SSL for everything. Are you on a corporate, university, etc. network? – abarnert Aug 06 '18 at 20:52
  • Can you even view https://bootstrap.pypa.io/get-pip.py in your browser? If so, you could save it as text from the browser and then run it… but that's not likely to help your larger problem, because, unless you have a really ancient version of curl, whatever curl is running into it probably going to affect pip 18 just as much… – abarnert Aug 06 '18 at 20:53
  • @abarnert I am on a corporate network but I can view that link, do you recommend then contacting the IT dept and ask them about this error? – user90823745 Aug 06 '18 at 20:55
  • Yes. If you can't view that link even in a browser, then that's your problem: your IT department is blocking you from accessing these domains. They may be doing that intentionally, in which case you'll need to make the case for why you need an exception, or they may be doing it accidentally, in which case hopefully they'll be able to fix it once you bring it to their attention. – abarnert Aug 06 '18 at 20:56
  • @abarnert I can view that link but I'll still see if I can get this fixed. Thanks for your help! – user90823745 Aug 06 '18 at 20:57
  • Oops, sorry, I misread. OK, then most likely either (a) there's a custom CA CERT installed into the cert chain used by your browser, but neither curl nor pip can see it, or (b) there's a (non-transparent) proxy you're supposed to be using and they pre-set things up for the browser, but not for curl or pip. Hopefully, if they don't have a problem with you using curl or pip, they can tell you what to do either way. But if they just say, e.g,, "That's allowed but not supported; here's the PEM file, if you know what to do with it", come back and ask what to do with it. :) – abarnert Aug 06 '18 at 20:58
  • @abarnert Will do, thanks! – user90823745 Aug 07 '18 at 11:32

0 Answers0