Pip SSL Error on Windows












4















I use Python 3.x on Windows 7 64 bit in an environment without full control of inbound/outbound traffic processing. Up till this week I've been able to use the --trusted-host pypi.python.org flag with pip and everything worked. This week I have started getting the following error even with the --trusted-host flag.



Could not fetch URL https://pypi.python.org/simple/pytubes/: There was a probl
em confirming the ssl certificate: [SSL: CERTIFICATE_VERIFY_FAILED] certificate
verify failed (_ssl.c:720) - skipping


I tried changing the --trusted-host flag to https://files.pythonhosted.org/packages/ in light of the pypi change this week, but that didn't seem to help.



I also tried downloading and installing the wheels of certifi, wincerstore and win32 certifi as well as other stackoverflow suggestions for this kind of issue such as the digistore .pem cert and pip.ini file without any success.



pip install fails with "connection error: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:598)"



Finally I tried upgrading pip to pip 10 from pip 9.0.3 following the instructions here: https://pip.pypa.io/en/stable/installing/



For the curl download I had to pass -k in, and running python get-pip.py fails with a similar ssl error to pip:



 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:749)'),)': /simple/pip/
Could not fetch URL https://pypi.org/simple/pip/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/pip/ (Caused by SSLError(SSLError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:749)'),)) - skipping
Could not find a version that satisfies the requirement pip (from versions: )
No matching distribution found for pip
Could not fetch URL https://pypi.org/simple/pip/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/pip/ (Caused by SSLError(SSLError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:749)'),)) - skipping


Appreciate any suggestions for next steps since the .pem file, Python CA packages and --trusted-host flag didn't do the trick



Edit:



New output with the -vvv flag in pip from an answer below.



 > pip install pytubes -vvv
Config variable 'Py_DEBUG' is unset, Python ABI tag may be incorrect
Config variable 'WITH_PYMALLOC' is unset, Python ABI tag may be incorrect
Collecting pytubes
1 location(s) to search for versions of pytubes:
* https://pypi.python.org/simple/pytubes/
Getting page https://pypi.python.org/simple/pytubes/
Looking up "https://pypi.python.org/simple/pytubes/" in the cache
No cache entry available
Starting new HTTPS connection (1): pypi.python.org
Could not fetch URL https://pypi.python.org/simple/pytubes/: There was a probl
em confirming the ssl certificate: [SSL: CERTIFICATE_VERIFY_FAILED] certificate
verify failed (_ssl.c:749) - skipping
Could not find a version that satisfies the requirement pytubes (from versions
: )
Cleaning up...
No matching distribution found for pytubes
Exception information:
Traceback (most recent call last):
File "C:ProgramDataAnaconda3libsite-packagespipbasecommand.py", line 215
, in main
status = self.run(options, args)
File "C:ProgramDataAnaconda3libsite-packagespipcommandsinstall.py", lin
e 335, in run
wb.build(autobuilding=True)
File "C:ProgramDataAnaconda3libsite-packagespipwheel.py", line 749, in b
uild
self.requirement_set.prepare_files(self.finder)
File "C:ProgramDataAnaconda3libsite-packagespipreqreq_set.py", line 380
, in prepare_files
ignore_dependencies=self.ignore_dependencies))
File "C:ProgramDataAnaconda3libsite-packagespipreqreq_set.py", line 554
, in _prepare_file
require_hashes
File "C:ProgramDataAnaconda3libsite-packagespipreqreq_install.py", line
278, in populate_link
self.link = finder.find_requirement(self, upgrade)
File "C:ProgramDataAnaconda3libsite-packagespipindex.py", line 514, in f
ind_requirement
'No matching distribution found for %s' % req
pip.exceptions.DistributionNotFound: No matching distribution found for pytubes
Looking up "https://pypi.python.org/pypi/pip/json" in the cache
No cache entry available
Starting new HTTPS connection (1): pypi.python.org
There was an error checking the latest version of pip
Traceback (most recent call last):
File "C:ProgramDataAnaconda3libsite-packagespip_vendorrequestspackages
urllib3connectionpool.py", line 595, in urlopen
chunked=chunked)
File "C:ProgramDataAnaconda3libsite-packagespip_vendorrequestspackages
urllib3connectionpool.py", line 352, in _make_request
self._validate_conn(conn)
File "C:ProgramDataAnaconda3libsite-packagespip_vendorrequestspackages
urllib3connectionpool.py", line 831, in _validate_conn
conn.connect()
File "C:ProgramDataAnaconda3libsite-packagespip_vendorrequestspackages
urllib3connection.py", line 289, in connect
ssl_version=resolved_ssl_version)
File "C:ProgramDataAnaconda3libsite-packagespip_vendorrequestspackages
urllib3utilssl_.py", line 308, in ssl_wrap_socket
return context.wrap_socket(sock, server_hostname=server_hostname)
File "C:ProgramDataAnaconda3libssl.py", line 401, in wrap_socket
_context=self, _session=session)
File "C:ProgramDataAnaconda3libssl.py", line 808, in __init__
self.do_handshake()
File "C:ProgramDataAnaconda3libssl.py", line 1061, in do_handshake
self._sslobj.do_handshake()
File "C:ProgramDataAnaconda3libssl.py", line 683, in do_handshake
self._sslobj.do_handshake()
ssl.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c
:749)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:ProgramDataAnaconda3libsite-packagespip_vendorrequestsadapters
.py", line 423, in send
timeout=timeout
File "C:ProgramDataAnaconda3libsite-packagespip_vendorrequestspackages
urllib3connectionpool.py", line 621, in urlopen
raise SSLError(e)
pip._vendor.requests.packages.urllib3.exceptions.SSLError: [SSL: CERTIFICATE_VER
IFY_FAILED] certificate verify failed (_ssl.c:749)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:ProgramDataAnaconda3libsite-packagespiputilsoutdated.py", line
126, in pip_version_check
headers={"Accept": "application/json"},
File "C:ProgramDataAnaconda3libsite-packagespip_vendorrequestssessions
.py", line 488, in get
return self.request('GET', url, **kwargs)
File "C:ProgramDataAnaconda3libsite-packagespipdownload.py", line 386, i
n request
return super(PipSession, self).request(method, url, *args, **kwargs)
File "C:ProgramDataAnaconda3libsite-packagespip_vendorrequestssessions
.py", line 475, in request
resp = self.send(prep, **send_kwargs)
File "C:ProgramDataAnaconda3libsite-packagespip_vendorrequestssessions
.py", line 596, in send
r = adapter.send(request, **kwargs)
File "C:ProgramDataAnaconda3libsite-packagespip_vendorcachecontroladap
ter.py", line 47, in send
resp = super(CacheControlAdapter, self).send(request, **kw)
File "C:ProgramDataAnaconda3libsite-packagespip_vendorrequestsadapters
.py", line 497, in send
raise SSLError(e, request=request)
pip._vendor.requests.exceptions.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certi
ficate verify failed (_ssl.c:749)









share|improve this question

























  • It's not the host that needs trusting. The message says that there's something wrong with the certificate. I don't get this error, nor does Chrome show any problems when I open https://pypi.org/simple/pytubes/. Are you using Fiddler perhaps? Working from a coffee shop or use anything that intercepts traffic and uses a self-signed certificate?

    – Panagiotis Kanavos
    Apr 20 '18 at 14:10













  • PS I didn't have to use --trusted-host either

    – Panagiotis Kanavos
    Apr 20 '18 at 14:11











  • I'm in an enterprise environment so it's entirely possible that there is something interacting with the traffic in our setup, but I'm not 100% of how everything is routed. Anyway for me to verify that? Also if I go to pypi.org/simple/pytubes in Chrome I don't get any problems and have the secure marker.

    – Alexander
    Apr 20 '18 at 14:19


















4















I use Python 3.x on Windows 7 64 bit in an environment without full control of inbound/outbound traffic processing. Up till this week I've been able to use the --trusted-host pypi.python.org flag with pip and everything worked. This week I have started getting the following error even with the --trusted-host flag.



Could not fetch URL https://pypi.python.org/simple/pytubes/: There was a probl
em confirming the ssl certificate: [SSL: CERTIFICATE_VERIFY_FAILED] certificate
verify failed (_ssl.c:720) - skipping


I tried changing the --trusted-host flag to https://files.pythonhosted.org/packages/ in light of the pypi change this week, but that didn't seem to help.



I also tried downloading and installing the wheels of certifi, wincerstore and win32 certifi as well as other stackoverflow suggestions for this kind of issue such as the digistore .pem cert and pip.ini file without any success.



pip install fails with "connection error: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:598)"



Finally I tried upgrading pip to pip 10 from pip 9.0.3 following the instructions here: https://pip.pypa.io/en/stable/installing/



For the curl download I had to pass -k in, and running python get-pip.py fails with a similar ssl error to pip:



 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:749)'),)': /simple/pip/
Could not fetch URL https://pypi.org/simple/pip/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/pip/ (Caused by SSLError(SSLError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:749)'),)) - skipping
Could not find a version that satisfies the requirement pip (from versions: )
No matching distribution found for pip
Could not fetch URL https://pypi.org/simple/pip/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/pip/ (Caused by SSLError(SSLError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:749)'),)) - skipping


Appreciate any suggestions for next steps since the .pem file, Python CA packages and --trusted-host flag didn't do the trick



Edit:



New output with the -vvv flag in pip from an answer below.



 > pip install pytubes -vvv
Config variable 'Py_DEBUG' is unset, Python ABI tag may be incorrect
Config variable 'WITH_PYMALLOC' is unset, Python ABI tag may be incorrect
Collecting pytubes
1 location(s) to search for versions of pytubes:
* https://pypi.python.org/simple/pytubes/
Getting page https://pypi.python.org/simple/pytubes/
Looking up "https://pypi.python.org/simple/pytubes/" in the cache
No cache entry available
Starting new HTTPS connection (1): pypi.python.org
Could not fetch URL https://pypi.python.org/simple/pytubes/: There was a probl
em confirming the ssl certificate: [SSL: CERTIFICATE_VERIFY_FAILED] certificate
verify failed (_ssl.c:749) - skipping
Could not find a version that satisfies the requirement pytubes (from versions
: )
Cleaning up...
No matching distribution found for pytubes
Exception information:
Traceback (most recent call last):
File "C:ProgramDataAnaconda3libsite-packagespipbasecommand.py", line 215
, in main
status = self.run(options, args)
File "C:ProgramDataAnaconda3libsite-packagespipcommandsinstall.py", lin
e 335, in run
wb.build(autobuilding=True)
File "C:ProgramDataAnaconda3libsite-packagespipwheel.py", line 749, in b
uild
self.requirement_set.prepare_files(self.finder)
File "C:ProgramDataAnaconda3libsite-packagespipreqreq_set.py", line 380
, in prepare_files
ignore_dependencies=self.ignore_dependencies))
File "C:ProgramDataAnaconda3libsite-packagespipreqreq_set.py", line 554
, in _prepare_file
require_hashes
File "C:ProgramDataAnaconda3libsite-packagespipreqreq_install.py", line
278, in populate_link
self.link = finder.find_requirement(self, upgrade)
File "C:ProgramDataAnaconda3libsite-packagespipindex.py", line 514, in f
ind_requirement
'No matching distribution found for %s' % req
pip.exceptions.DistributionNotFound: No matching distribution found for pytubes
Looking up "https://pypi.python.org/pypi/pip/json" in the cache
No cache entry available
Starting new HTTPS connection (1): pypi.python.org
There was an error checking the latest version of pip
Traceback (most recent call last):
File "C:ProgramDataAnaconda3libsite-packagespip_vendorrequestspackages
urllib3connectionpool.py", line 595, in urlopen
chunked=chunked)
File "C:ProgramDataAnaconda3libsite-packagespip_vendorrequestspackages
urllib3connectionpool.py", line 352, in _make_request
self._validate_conn(conn)
File "C:ProgramDataAnaconda3libsite-packagespip_vendorrequestspackages
urllib3connectionpool.py", line 831, in _validate_conn
conn.connect()
File "C:ProgramDataAnaconda3libsite-packagespip_vendorrequestspackages
urllib3connection.py", line 289, in connect
ssl_version=resolved_ssl_version)
File "C:ProgramDataAnaconda3libsite-packagespip_vendorrequestspackages
urllib3utilssl_.py", line 308, in ssl_wrap_socket
return context.wrap_socket(sock, server_hostname=server_hostname)
File "C:ProgramDataAnaconda3libssl.py", line 401, in wrap_socket
_context=self, _session=session)
File "C:ProgramDataAnaconda3libssl.py", line 808, in __init__
self.do_handshake()
File "C:ProgramDataAnaconda3libssl.py", line 1061, in do_handshake
self._sslobj.do_handshake()
File "C:ProgramDataAnaconda3libssl.py", line 683, in do_handshake
self._sslobj.do_handshake()
ssl.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c
:749)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:ProgramDataAnaconda3libsite-packagespip_vendorrequestsadapters
.py", line 423, in send
timeout=timeout
File "C:ProgramDataAnaconda3libsite-packagespip_vendorrequestspackages
urllib3connectionpool.py", line 621, in urlopen
raise SSLError(e)
pip._vendor.requests.packages.urllib3.exceptions.SSLError: [SSL: CERTIFICATE_VER
IFY_FAILED] certificate verify failed (_ssl.c:749)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:ProgramDataAnaconda3libsite-packagespiputilsoutdated.py", line
126, in pip_version_check
headers={"Accept": "application/json"},
File "C:ProgramDataAnaconda3libsite-packagespip_vendorrequestssessions
.py", line 488, in get
return self.request('GET', url, **kwargs)
File "C:ProgramDataAnaconda3libsite-packagespipdownload.py", line 386, i
n request
return super(PipSession, self).request(method, url, *args, **kwargs)
File "C:ProgramDataAnaconda3libsite-packagespip_vendorrequestssessions
.py", line 475, in request
resp = self.send(prep, **send_kwargs)
File "C:ProgramDataAnaconda3libsite-packagespip_vendorrequestssessions
.py", line 596, in send
r = adapter.send(request, **kwargs)
File "C:ProgramDataAnaconda3libsite-packagespip_vendorcachecontroladap
ter.py", line 47, in send
resp = super(CacheControlAdapter, self).send(request, **kw)
File "C:ProgramDataAnaconda3libsite-packagespip_vendorrequestsadapters
.py", line 497, in send
raise SSLError(e, request=request)
pip._vendor.requests.exceptions.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certi
ficate verify failed (_ssl.c:749)









share|improve this question

























  • It's not the host that needs trusting. The message says that there's something wrong with the certificate. I don't get this error, nor does Chrome show any problems when I open https://pypi.org/simple/pytubes/. Are you using Fiddler perhaps? Working from a coffee shop or use anything that intercepts traffic and uses a self-signed certificate?

    – Panagiotis Kanavos
    Apr 20 '18 at 14:10













  • PS I didn't have to use --trusted-host either

    – Panagiotis Kanavos
    Apr 20 '18 at 14:11











  • I'm in an enterprise environment so it's entirely possible that there is something interacting with the traffic in our setup, but I'm not 100% of how everything is routed. Anyway for me to verify that? Also if I go to pypi.org/simple/pytubes in Chrome I don't get any problems and have the secure marker.

    – Alexander
    Apr 20 '18 at 14:19
















4












4








4


4






I use Python 3.x on Windows 7 64 bit in an environment without full control of inbound/outbound traffic processing. Up till this week I've been able to use the --trusted-host pypi.python.org flag with pip and everything worked. This week I have started getting the following error even with the --trusted-host flag.



Could not fetch URL https://pypi.python.org/simple/pytubes/: There was a probl
em confirming the ssl certificate: [SSL: CERTIFICATE_VERIFY_FAILED] certificate
verify failed (_ssl.c:720) - skipping


I tried changing the --trusted-host flag to https://files.pythonhosted.org/packages/ in light of the pypi change this week, but that didn't seem to help.



I also tried downloading and installing the wheels of certifi, wincerstore and win32 certifi as well as other stackoverflow suggestions for this kind of issue such as the digistore .pem cert and pip.ini file without any success.



pip install fails with "connection error: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:598)"



Finally I tried upgrading pip to pip 10 from pip 9.0.3 following the instructions here: https://pip.pypa.io/en/stable/installing/



For the curl download I had to pass -k in, and running python get-pip.py fails with a similar ssl error to pip:



 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:749)'),)': /simple/pip/
Could not fetch URL https://pypi.org/simple/pip/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/pip/ (Caused by SSLError(SSLError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:749)'),)) - skipping
Could not find a version that satisfies the requirement pip (from versions: )
No matching distribution found for pip
Could not fetch URL https://pypi.org/simple/pip/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/pip/ (Caused by SSLError(SSLError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:749)'),)) - skipping


Appreciate any suggestions for next steps since the .pem file, Python CA packages and --trusted-host flag didn't do the trick



Edit:



New output with the -vvv flag in pip from an answer below.



 > pip install pytubes -vvv
Config variable 'Py_DEBUG' is unset, Python ABI tag may be incorrect
Config variable 'WITH_PYMALLOC' is unset, Python ABI tag may be incorrect
Collecting pytubes
1 location(s) to search for versions of pytubes:
* https://pypi.python.org/simple/pytubes/
Getting page https://pypi.python.org/simple/pytubes/
Looking up "https://pypi.python.org/simple/pytubes/" in the cache
No cache entry available
Starting new HTTPS connection (1): pypi.python.org
Could not fetch URL https://pypi.python.org/simple/pytubes/: There was a probl
em confirming the ssl certificate: [SSL: CERTIFICATE_VERIFY_FAILED] certificate
verify failed (_ssl.c:749) - skipping
Could not find a version that satisfies the requirement pytubes (from versions
: )
Cleaning up...
No matching distribution found for pytubes
Exception information:
Traceback (most recent call last):
File "C:ProgramDataAnaconda3libsite-packagespipbasecommand.py", line 215
, in main
status = self.run(options, args)
File "C:ProgramDataAnaconda3libsite-packagespipcommandsinstall.py", lin
e 335, in run
wb.build(autobuilding=True)
File "C:ProgramDataAnaconda3libsite-packagespipwheel.py", line 749, in b
uild
self.requirement_set.prepare_files(self.finder)
File "C:ProgramDataAnaconda3libsite-packagespipreqreq_set.py", line 380
, in prepare_files
ignore_dependencies=self.ignore_dependencies))
File "C:ProgramDataAnaconda3libsite-packagespipreqreq_set.py", line 554
, in _prepare_file
require_hashes
File "C:ProgramDataAnaconda3libsite-packagespipreqreq_install.py", line
278, in populate_link
self.link = finder.find_requirement(self, upgrade)
File "C:ProgramDataAnaconda3libsite-packagespipindex.py", line 514, in f
ind_requirement
'No matching distribution found for %s' % req
pip.exceptions.DistributionNotFound: No matching distribution found for pytubes
Looking up "https://pypi.python.org/pypi/pip/json" in the cache
No cache entry available
Starting new HTTPS connection (1): pypi.python.org
There was an error checking the latest version of pip
Traceback (most recent call last):
File "C:ProgramDataAnaconda3libsite-packagespip_vendorrequestspackages
urllib3connectionpool.py", line 595, in urlopen
chunked=chunked)
File "C:ProgramDataAnaconda3libsite-packagespip_vendorrequestspackages
urllib3connectionpool.py", line 352, in _make_request
self._validate_conn(conn)
File "C:ProgramDataAnaconda3libsite-packagespip_vendorrequestspackages
urllib3connectionpool.py", line 831, in _validate_conn
conn.connect()
File "C:ProgramDataAnaconda3libsite-packagespip_vendorrequestspackages
urllib3connection.py", line 289, in connect
ssl_version=resolved_ssl_version)
File "C:ProgramDataAnaconda3libsite-packagespip_vendorrequestspackages
urllib3utilssl_.py", line 308, in ssl_wrap_socket
return context.wrap_socket(sock, server_hostname=server_hostname)
File "C:ProgramDataAnaconda3libssl.py", line 401, in wrap_socket
_context=self, _session=session)
File "C:ProgramDataAnaconda3libssl.py", line 808, in __init__
self.do_handshake()
File "C:ProgramDataAnaconda3libssl.py", line 1061, in do_handshake
self._sslobj.do_handshake()
File "C:ProgramDataAnaconda3libssl.py", line 683, in do_handshake
self._sslobj.do_handshake()
ssl.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c
:749)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:ProgramDataAnaconda3libsite-packagespip_vendorrequestsadapters
.py", line 423, in send
timeout=timeout
File "C:ProgramDataAnaconda3libsite-packagespip_vendorrequestspackages
urllib3connectionpool.py", line 621, in urlopen
raise SSLError(e)
pip._vendor.requests.packages.urllib3.exceptions.SSLError: [SSL: CERTIFICATE_VER
IFY_FAILED] certificate verify failed (_ssl.c:749)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:ProgramDataAnaconda3libsite-packagespiputilsoutdated.py", line
126, in pip_version_check
headers={"Accept": "application/json"},
File "C:ProgramDataAnaconda3libsite-packagespip_vendorrequestssessions
.py", line 488, in get
return self.request('GET', url, **kwargs)
File "C:ProgramDataAnaconda3libsite-packagespipdownload.py", line 386, i
n request
return super(PipSession, self).request(method, url, *args, **kwargs)
File "C:ProgramDataAnaconda3libsite-packagespip_vendorrequestssessions
.py", line 475, in request
resp = self.send(prep, **send_kwargs)
File "C:ProgramDataAnaconda3libsite-packagespip_vendorrequestssessions
.py", line 596, in send
r = adapter.send(request, **kwargs)
File "C:ProgramDataAnaconda3libsite-packagespip_vendorcachecontroladap
ter.py", line 47, in send
resp = super(CacheControlAdapter, self).send(request, **kw)
File "C:ProgramDataAnaconda3libsite-packagespip_vendorrequestsadapters
.py", line 497, in send
raise SSLError(e, request=request)
pip._vendor.requests.exceptions.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certi
ficate verify failed (_ssl.c:749)









share|improve this question
















I use Python 3.x on Windows 7 64 bit in an environment without full control of inbound/outbound traffic processing. Up till this week I've been able to use the --trusted-host pypi.python.org flag with pip and everything worked. This week I have started getting the following error even with the --trusted-host flag.



Could not fetch URL https://pypi.python.org/simple/pytubes/: There was a probl
em confirming the ssl certificate: [SSL: CERTIFICATE_VERIFY_FAILED] certificate
verify failed (_ssl.c:720) - skipping


I tried changing the --trusted-host flag to https://files.pythonhosted.org/packages/ in light of the pypi change this week, but that didn't seem to help.



I also tried downloading and installing the wheels of certifi, wincerstore and win32 certifi as well as other stackoverflow suggestions for this kind of issue such as the digistore .pem cert and pip.ini file without any success.



pip install fails with "connection error: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:598)"



Finally I tried upgrading pip to pip 10 from pip 9.0.3 following the instructions here: https://pip.pypa.io/en/stable/installing/



For the curl download I had to pass -k in, and running python get-pip.py fails with a similar ssl error to pip:



 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:749)'),)': /simple/pip/
Could not fetch URL https://pypi.org/simple/pip/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/pip/ (Caused by SSLError(SSLError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:749)'),)) - skipping
Could not find a version that satisfies the requirement pip (from versions: )
No matching distribution found for pip
Could not fetch URL https://pypi.org/simple/pip/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/pip/ (Caused by SSLError(SSLError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:749)'),)) - skipping


Appreciate any suggestions for next steps since the .pem file, Python CA packages and --trusted-host flag didn't do the trick



Edit:



New output with the -vvv flag in pip from an answer below.



 > pip install pytubes -vvv
Config variable 'Py_DEBUG' is unset, Python ABI tag may be incorrect
Config variable 'WITH_PYMALLOC' is unset, Python ABI tag may be incorrect
Collecting pytubes
1 location(s) to search for versions of pytubes:
* https://pypi.python.org/simple/pytubes/
Getting page https://pypi.python.org/simple/pytubes/
Looking up "https://pypi.python.org/simple/pytubes/" in the cache
No cache entry available
Starting new HTTPS connection (1): pypi.python.org
Could not fetch URL https://pypi.python.org/simple/pytubes/: There was a probl
em confirming the ssl certificate: [SSL: CERTIFICATE_VERIFY_FAILED] certificate
verify failed (_ssl.c:749) - skipping
Could not find a version that satisfies the requirement pytubes (from versions
: )
Cleaning up...
No matching distribution found for pytubes
Exception information:
Traceback (most recent call last):
File "C:ProgramDataAnaconda3libsite-packagespipbasecommand.py", line 215
, in main
status = self.run(options, args)
File "C:ProgramDataAnaconda3libsite-packagespipcommandsinstall.py", lin
e 335, in run
wb.build(autobuilding=True)
File "C:ProgramDataAnaconda3libsite-packagespipwheel.py", line 749, in b
uild
self.requirement_set.prepare_files(self.finder)
File "C:ProgramDataAnaconda3libsite-packagespipreqreq_set.py", line 380
, in prepare_files
ignore_dependencies=self.ignore_dependencies))
File "C:ProgramDataAnaconda3libsite-packagespipreqreq_set.py", line 554
, in _prepare_file
require_hashes
File "C:ProgramDataAnaconda3libsite-packagespipreqreq_install.py", line
278, in populate_link
self.link = finder.find_requirement(self, upgrade)
File "C:ProgramDataAnaconda3libsite-packagespipindex.py", line 514, in f
ind_requirement
'No matching distribution found for %s' % req
pip.exceptions.DistributionNotFound: No matching distribution found for pytubes
Looking up "https://pypi.python.org/pypi/pip/json" in the cache
No cache entry available
Starting new HTTPS connection (1): pypi.python.org
There was an error checking the latest version of pip
Traceback (most recent call last):
File "C:ProgramDataAnaconda3libsite-packagespip_vendorrequestspackages
urllib3connectionpool.py", line 595, in urlopen
chunked=chunked)
File "C:ProgramDataAnaconda3libsite-packagespip_vendorrequestspackages
urllib3connectionpool.py", line 352, in _make_request
self._validate_conn(conn)
File "C:ProgramDataAnaconda3libsite-packagespip_vendorrequestspackages
urllib3connectionpool.py", line 831, in _validate_conn
conn.connect()
File "C:ProgramDataAnaconda3libsite-packagespip_vendorrequestspackages
urllib3connection.py", line 289, in connect
ssl_version=resolved_ssl_version)
File "C:ProgramDataAnaconda3libsite-packagespip_vendorrequestspackages
urllib3utilssl_.py", line 308, in ssl_wrap_socket
return context.wrap_socket(sock, server_hostname=server_hostname)
File "C:ProgramDataAnaconda3libssl.py", line 401, in wrap_socket
_context=self, _session=session)
File "C:ProgramDataAnaconda3libssl.py", line 808, in __init__
self.do_handshake()
File "C:ProgramDataAnaconda3libssl.py", line 1061, in do_handshake
self._sslobj.do_handshake()
File "C:ProgramDataAnaconda3libssl.py", line 683, in do_handshake
self._sslobj.do_handshake()
ssl.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c
:749)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:ProgramDataAnaconda3libsite-packagespip_vendorrequestsadapters
.py", line 423, in send
timeout=timeout
File "C:ProgramDataAnaconda3libsite-packagespip_vendorrequestspackages
urllib3connectionpool.py", line 621, in urlopen
raise SSLError(e)
pip._vendor.requests.packages.urllib3.exceptions.SSLError: [SSL: CERTIFICATE_VER
IFY_FAILED] certificate verify failed (_ssl.c:749)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:ProgramDataAnaconda3libsite-packagespiputilsoutdated.py", line
126, in pip_version_check
headers={"Accept": "application/json"},
File "C:ProgramDataAnaconda3libsite-packagespip_vendorrequestssessions
.py", line 488, in get
return self.request('GET', url, **kwargs)
File "C:ProgramDataAnaconda3libsite-packagespipdownload.py", line 386, i
n request
return super(PipSession, self).request(method, url, *args, **kwargs)
File "C:ProgramDataAnaconda3libsite-packagespip_vendorrequestssessions
.py", line 475, in request
resp = self.send(prep, **send_kwargs)
File "C:ProgramDataAnaconda3libsite-packagespip_vendorrequestssessions
.py", line 596, in send
r = adapter.send(request, **kwargs)
File "C:ProgramDataAnaconda3libsite-packagespip_vendorcachecontroladap
ter.py", line 47, in send
resp = super(CacheControlAdapter, self).send(request, **kw)
File "C:ProgramDataAnaconda3libsite-packagespip_vendorrequestsadapters
.py", line 497, in send
raise SSLError(e, request=request)
pip._vendor.requests.exceptions.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certi
ficate verify failed (_ssl.c:749)






python windows ssl pip






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Apr 24 '18 at 12:34







Alexander

















asked Apr 20 '18 at 14:01









AlexanderAlexander

4581125




4581125













  • It's not the host that needs trusting. The message says that there's something wrong with the certificate. I don't get this error, nor does Chrome show any problems when I open https://pypi.org/simple/pytubes/. Are you using Fiddler perhaps? Working from a coffee shop or use anything that intercepts traffic and uses a self-signed certificate?

    – Panagiotis Kanavos
    Apr 20 '18 at 14:10













  • PS I didn't have to use --trusted-host either

    – Panagiotis Kanavos
    Apr 20 '18 at 14:11











  • I'm in an enterprise environment so it's entirely possible that there is something interacting with the traffic in our setup, but I'm not 100% of how everything is routed. Anyway for me to verify that? Also if I go to pypi.org/simple/pytubes in Chrome I don't get any problems and have the secure marker.

    – Alexander
    Apr 20 '18 at 14:19





















  • It's not the host that needs trusting. The message says that there's something wrong with the certificate. I don't get this error, nor does Chrome show any problems when I open https://pypi.org/simple/pytubes/. Are you using Fiddler perhaps? Working from a coffee shop or use anything that intercepts traffic and uses a self-signed certificate?

    – Panagiotis Kanavos
    Apr 20 '18 at 14:10













  • PS I didn't have to use --trusted-host either

    – Panagiotis Kanavos
    Apr 20 '18 at 14:11











  • I'm in an enterprise environment so it's entirely possible that there is something interacting with the traffic in our setup, but I'm not 100% of how everything is routed. Anyway for me to verify that? Also if I go to pypi.org/simple/pytubes in Chrome I don't get any problems and have the secure marker.

    – Alexander
    Apr 20 '18 at 14:19



















It's not the host that needs trusting. The message says that there's something wrong with the certificate. I don't get this error, nor does Chrome show any problems when I open https://pypi.org/simple/pytubes/. Are you using Fiddler perhaps? Working from a coffee shop or use anything that intercepts traffic and uses a self-signed certificate?

– Panagiotis Kanavos
Apr 20 '18 at 14:10







It's not the host that needs trusting. The message says that there's something wrong with the certificate. I don't get this error, nor does Chrome show any problems when I open https://pypi.org/simple/pytubes/. Are you using Fiddler perhaps? Working from a coffee shop or use anything that intercepts traffic and uses a self-signed certificate?

– Panagiotis Kanavos
Apr 20 '18 at 14:10















PS I didn't have to use --trusted-host either

– Panagiotis Kanavos
Apr 20 '18 at 14:11





PS I didn't have to use --trusted-host either

– Panagiotis Kanavos
Apr 20 '18 at 14:11













I'm in an enterprise environment so it's entirely possible that there is something interacting with the traffic in our setup, but I'm not 100% of how everything is routed. Anyway for me to verify that? Also if I go to pypi.org/simple/pytubes in Chrome I don't get any problems and have the secure marker.

– Alexander
Apr 20 '18 at 14:19







I'm in an enterprise environment so it's entirely possible that there is something interacting with the traffic in our setup, but I'm not 100% of how everything is routed. Anyway for me to verify that? Also if I go to pypi.org/simple/pytubes in Chrome I don't get any problems and have the secure marker.

– Alexander
Apr 20 '18 at 14:19














5 Answers
5






active

oldest

votes


















12














What ended up working for me is to add all the domains that are part of the new pypi routing.



pip install --trusted-host pypi.org --trusted-host pypi.python.org --trusted-host files.pythonhosted.org <package>


Which can also be setup in a pip.ini file.






share|improve this answer































    4














    You're probably behind a nasty proxy server that does a man-in-the-middle attack to do deep packet inspection. You need to obtain the CA certificate file from your proxy admin in order to tell Python that everything is OK. You could also extract this from your web browser or anything else that is configured to work with the proxy.



    When you have obtained the certificate, you can either add it to the cacert.pem file of the certifi package, or tell pip about it directly with the --cert option, or global.cert in the pip.conf file.






    share|improve this answer
























    • I think this is part of it. I'm working with others now to help with the CA and SSL component. I'll update this with the final resolution and mark the appropriate answer.

      – Alexander
      Apr 24 '18 at 12:24



















    1














    I have been having similar problems with pip since a few days ago. It looks like they have updated the security certificate for pypi.python.org, since it's valid from March 28th 2018, and it currently only supports TLS 1.2.



    For information about the currently used certificate, see here.



    EDIT:



    Possible duplicate of pip always fails ssl verification



    EDIT2:



    @Alexander: Which version of Python 3.X are you using exactly? Make sure you have at least Python 3.1, just do python --version.



    EDIT3:



    I meant: 3.6.1.






    share|improve this answer


























    • I have no problems with it. I don't even need to use --trusted-host. If there was an issue with the certificate it would show up in the browser

      – Panagiotis Kanavos
      Apr 20 '18 at 14:38













    • I did not say it is an issue with the certificate per se. The problem is that modern version of TLS require an upgrade of OpenSSL libraries. If your installation does not support TLS 1.2 you can't validate this kind of certificate.

      – GiulioP
      Apr 20 '18 at 15:01











    • On second thought, since curl needs the --k (i.e. --insecure) option to succeed, there may be some proxy in the middle which is causing the issue. @Alexander, can you try to run tracert pypi.python.org on the cmd and see if anything weird comes up?

      – GiulioP
      Apr 20 '18 at 15:12











    • I get a couple hops and then the request all begin timing out I never reach the destination.

      – Alexander
      Apr 20 '18 at 16:34






    • 1





      Using Python 2.7 I was having a similar issue but with Python 2.7.13 it works, thus the last number (known as micro version) actually matters. With 3.6.1 it works as well, so if you are using Python 3.6 you may wish to try 3.6.1 instead.

      – GiulioP
      Apr 24 '18 at 12:34





















    0














    I had the same proplem and I solved it during the installation of tensorflow. Here is the solution in steps:




    1. Access the file relevant to SSL. Find the folder in the install location, where sessions.py is located. (I guess it is in folder ~~~₩pip₩vender₩requests)


    2. Open sessions.py and modify self.verify = True to self.verify = False



    3. Install using trusted host code as below



      pip install --trusted-host pypi.org --trusted-host files.pythonhosted.org <package name> 







    share|improve this answer

































      -1














      Best solution i felt is:-
      Access the file relevant to SSL. Find the folder in the install location, where sessions.py is located. (I guess it is in folder ~~~₩pip₩vender₩requests)



      Open sessions.py and modify self.verify = True to self.verify = False



      Install using trusted host code as below






      share|improve this answer



















      • 1





        This answer seems incomplete. Where is the code in "Install using trusted host code as below"?

        – Samuel Liew
        Nov 14 '18 at 1:04











      Your Answer






      StackExchange.ifUsing("editor", function () {
      StackExchange.using("externalEditor", function () {
      StackExchange.using("snippets", function () {
      StackExchange.snippets.init();
      });
      });
      }, "code-snippets");

      StackExchange.ready(function() {
      var channelOptions = {
      tags: "".split(" "),
      id: "1"
      };
      initTagRenderer("".split(" "), "".split(" "), channelOptions);

      StackExchange.using("externalEditor", function() {
      // Have to fire editor after snippets, if snippets enabled
      if (StackExchange.settings.snippets.snippetsEnabled) {
      StackExchange.using("snippets", function() {
      createEditor();
      });
      }
      else {
      createEditor();
      }
      });

      function createEditor() {
      StackExchange.prepareEditor({
      heartbeatType: 'answer',
      autoActivateHeartbeat: false,
      convertImagesToLinks: true,
      noModals: true,
      showLowRepImageUploadWarning: true,
      reputationToPostImages: 10,
      bindNavPrevention: true,
      postfix: "",
      imageUploader: {
      brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
      contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
      allowUrls: true
      },
      onDemand: true,
      discardSelector: ".discard-answer"
      ,immediatelyShowMarkdownHelp:true
      });


      }
      });














      draft saved

      draft discarded


















      StackExchange.ready(
      function () {
      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f49943410%2fpip-ssl-error-on-windows%23new-answer', 'question_page');
      }
      );

      Post as a guest















      Required, but never shown

























      5 Answers
      5






      active

      oldest

      votes








      5 Answers
      5






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes









      12














      What ended up working for me is to add all the domains that are part of the new pypi routing.



      pip install --trusted-host pypi.org --trusted-host pypi.python.org --trusted-host files.pythonhosted.org <package>


      Which can also be setup in a pip.ini file.






      share|improve this answer




























        12














        What ended up working for me is to add all the domains that are part of the new pypi routing.



        pip install --trusted-host pypi.org --trusted-host pypi.python.org --trusted-host files.pythonhosted.org <package>


        Which can also be setup in a pip.ini file.






        share|improve this answer


























          12












          12








          12







          What ended up working for me is to add all the domains that are part of the new pypi routing.



          pip install --trusted-host pypi.org --trusted-host pypi.python.org --trusted-host files.pythonhosted.org <package>


          Which can also be setup in a pip.ini file.






          share|improve this answer













          What ended up working for me is to add all the domains that are part of the new pypi routing.



          pip install --trusted-host pypi.org --trusted-host pypi.python.org --trusted-host files.pythonhosted.org <package>


          Which can also be setup in a pip.ini file.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered May 3 '18 at 16:09









          AlexanderAlexander

          4581125




          4581125

























              4














              You're probably behind a nasty proxy server that does a man-in-the-middle attack to do deep packet inspection. You need to obtain the CA certificate file from your proxy admin in order to tell Python that everything is OK. You could also extract this from your web browser or anything else that is configured to work with the proxy.



              When you have obtained the certificate, you can either add it to the cacert.pem file of the certifi package, or tell pip about it directly with the --cert option, or global.cert in the pip.conf file.






              share|improve this answer
























              • I think this is part of it. I'm working with others now to help with the CA and SSL component. I'll update this with the final resolution and mark the appropriate answer.

                – Alexander
                Apr 24 '18 at 12:24
















              4














              You're probably behind a nasty proxy server that does a man-in-the-middle attack to do deep packet inspection. You need to obtain the CA certificate file from your proxy admin in order to tell Python that everything is OK. You could also extract this from your web browser or anything else that is configured to work with the proxy.



              When you have obtained the certificate, you can either add it to the cacert.pem file of the certifi package, or tell pip about it directly with the --cert option, or global.cert in the pip.conf file.






              share|improve this answer
























              • I think this is part of it. I'm working with others now to help with the CA and SSL component. I'll update this with the final resolution and mark the appropriate answer.

                – Alexander
                Apr 24 '18 at 12:24














              4












              4








              4







              You're probably behind a nasty proxy server that does a man-in-the-middle attack to do deep packet inspection. You need to obtain the CA certificate file from your proxy admin in order to tell Python that everything is OK. You could also extract this from your web browser or anything else that is configured to work with the proxy.



              When you have obtained the certificate, you can either add it to the cacert.pem file of the certifi package, or tell pip about it directly with the --cert option, or global.cert in the pip.conf file.






              share|improve this answer













              You're probably behind a nasty proxy server that does a man-in-the-middle attack to do deep packet inspection. You need to obtain the CA certificate file from your proxy admin in order to tell Python that everything is OK. You could also extract this from your web browser or anything else that is configured to work with the proxy.



              When you have obtained the certificate, you can either add it to the cacert.pem file of the certifi package, or tell pip about it directly with the --cert option, or global.cert in the pip.conf file.







              share|improve this answer












              share|improve this answer



              share|improve this answer










              answered Apr 20 '18 at 14:33









              George KettleboroughGeorge Kettleborough

              1112




              1112













              • I think this is part of it. I'm working with others now to help with the CA and SSL component. I'll update this with the final resolution and mark the appropriate answer.

                – Alexander
                Apr 24 '18 at 12:24



















              • I think this is part of it. I'm working with others now to help with the CA and SSL component. I'll update this with the final resolution and mark the appropriate answer.

                – Alexander
                Apr 24 '18 at 12:24

















              I think this is part of it. I'm working with others now to help with the CA and SSL component. I'll update this with the final resolution and mark the appropriate answer.

              – Alexander
              Apr 24 '18 at 12:24





              I think this is part of it. I'm working with others now to help with the CA and SSL component. I'll update this with the final resolution and mark the appropriate answer.

              – Alexander
              Apr 24 '18 at 12:24











              1














              I have been having similar problems with pip since a few days ago. It looks like they have updated the security certificate for pypi.python.org, since it's valid from March 28th 2018, and it currently only supports TLS 1.2.



              For information about the currently used certificate, see here.



              EDIT:



              Possible duplicate of pip always fails ssl verification



              EDIT2:



              @Alexander: Which version of Python 3.X are you using exactly? Make sure you have at least Python 3.1, just do python --version.



              EDIT3:



              I meant: 3.6.1.






              share|improve this answer


























              • I have no problems with it. I don't even need to use --trusted-host. If there was an issue with the certificate it would show up in the browser

                – Panagiotis Kanavos
                Apr 20 '18 at 14:38













              • I did not say it is an issue with the certificate per se. The problem is that modern version of TLS require an upgrade of OpenSSL libraries. If your installation does not support TLS 1.2 you can't validate this kind of certificate.

                – GiulioP
                Apr 20 '18 at 15:01











              • On second thought, since curl needs the --k (i.e. --insecure) option to succeed, there may be some proxy in the middle which is causing the issue. @Alexander, can you try to run tracert pypi.python.org on the cmd and see if anything weird comes up?

                – GiulioP
                Apr 20 '18 at 15:12











              • I get a couple hops and then the request all begin timing out I never reach the destination.

                – Alexander
                Apr 20 '18 at 16:34






              • 1





                Using Python 2.7 I was having a similar issue but with Python 2.7.13 it works, thus the last number (known as micro version) actually matters. With 3.6.1 it works as well, so if you are using Python 3.6 you may wish to try 3.6.1 instead.

                – GiulioP
                Apr 24 '18 at 12:34


















              1














              I have been having similar problems with pip since a few days ago. It looks like they have updated the security certificate for pypi.python.org, since it's valid from March 28th 2018, and it currently only supports TLS 1.2.



              For information about the currently used certificate, see here.



              EDIT:



              Possible duplicate of pip always fails ssl verification



              EDIT2:



              @Alexander: Which version of Python 3.X are you using exactly? Make sure you have at least Python 3.1, just do python --version.



              EDIT3:



              I meant: 3.6.1.






              share|improve this answer


























              • I have no problems with it. I don't even need to use --trusted-host. If there was an issue with the certificate it would show up in the browser

                – Panagiotis Kanavos
                Apr 20 '18 at 14:38













              • I did not say it is an issue with the certificate per se. The problem is that modern version of TLS require an upgrade of OpenSSL libraries. If your installation does not support TLS 1.2 you can't validate this kind of certificate.

                – GiulioP
                Apr 20 '18 at 15:01











              • On second thought, since curl needs the --k (i.e. --insecure) option to succeed, there may be some proxy in the middle which is causing the issue. @Alexander, can you try to run tracert pypi.python.org on the cmd and see if anything weird comes up?

                – GiulioP
                Apr 20 '18 at 15:12











              • I get a couple hops and then the request all begin timing out I never reach the destination.

                – Alexander
                Apr 20 '18 at 16:34






              • 1





                Using Python 2.7 I was having a similar issue but with Python 2.7.13 it works, thus the last number (known as micro version) actually matters. With 3.6.1 it works as well, so if you are using Python 3.6 you may wish to try 3.6.1 instead.

                – GiulioP
                Apr 24 '18 at 12:34
















              1












              1








              1







              I have been having similar problems with pip since a few days ago. It looks like they have updated the security certificate for pypi.python.org, since it's valid from March 28th 2018, and it currently only supports TLS 1.2.



              For information about the currently used certificate, see here.



              EDIT:



              Possible duplicate of pip always fails ssl verification



              EDIT2:



              @Alexander: Which version of Python 3.X are you using exactly? Make sure you have at least Python 3.1, just do python --version.



              EDIT3:



              I meant: 3.6.1.






              share|improve this answer















              I have been having similar problems with pip since a few days ago. It looks like they have updated the security certificate for pypi.python.org, since it's valid from March 28th 2018, and it currently only supports TLS 1.2.



              For information about the currently used certificate, see here.



              EDIT:



              Possible duplicate of pip always fails ssl verification



              EDIT2:



              @Alexander: Which version of Python 3.X are you using exactly? Make sure you have at least Python 3.1, just do python --version.



              EDIT3:



              I meant: 3.6.1.







              share|improve this answer














              share|improve this answer



              share|improve this answer








              edited Apr 24 '18 at 12:37

























              answered Apr 20 '18 at 14:28









              GiulioPGiulioP

              966




              966













              • I have no problems with it. I don't even need to use --trusted-host. If there was an issue with the certificate it would show up in the browser

                – Panagiotis Kanavos
                Apr 20 '18 at 14:38













              • I did not say it is an issue with the certificate per se. The problem is that modern version of TLS require an upgrade of OpenSSL libraries. If your installation does not support TLS 1.2 you can't validate this kind of certificate.

                – GiulioP
                Apr 20 '18 at 15:01











              • On second thought, since curl needs the --k (i.e. --insecure) option to succeed, there may be some proxy in the middle which is causing the issue. @Alexander, can you try to run tracert pypi.python.org on the cmd and see if anything weird comes up?

                – GiulioP
                Apr 20 '18 at 15:12











              • I get a couple hops and then the request all begin timing out I never reach the destination.

                – Alexander
                Apr 20 '18 at 16:34






              • 1





                Using Python 2.7 I was having a similar issue but with Python 2.7.13 it works, thus the last number (known as micro version) actually matters. With 3.6.1 it works as well, so if you are using Python 3.6 you may wish to try 3.6.1 instead.

                – GiulioP
                Apr 24 '18 at 12:34





















              • I have no problems with it. I don't even need to use --trusted-host. If there was an issue with the certificate it would show up in the browser

                – Panagiotis Kanavos
                Apr 20 '18 at 14:38













              • I did not say it is an issue with the certificate per se. The problem is that modern version of TLS require an upgrade of OpenSSL libraries. If your installation does not support TLS 1.2 you can't validate this kind of certificate.

                – GiulioP
                Apr 20 '18 at 15:01











              • On second thought, since curl needs the --k (i.e. --insecure) option to succeed, there may be some proxy in the middle which is causing the issue. @Alexander, can you try to run tracert pypi.python.org on the cmd and see if anything weird comes up?

                – GiulioP
                Apr 20 '18 at 15:12











              • I get a couple hops and then the request all begin timing out I never reach the destination.

                – Alexander
                Apr 20 '18 at 16:34






              • 1





                Using Python 2.7 I was having a similar issue but with Python 2.7.13 it works, thus the last number (known as micro version) actually matters. With 3.6.1 it works as well, so if you are using Python 3.6 you may wish to try 3.6.1 instead.

                – GiulioP
                Apr 24 '18 at 12:34



















              I have no problems with it. I don't even need to use --trusted-host. If there was an issue with the certificate it would show up in the browser

              – Panagiotis Kanavos
              Apr 20 '18 at 14:38







              I have no problems with it. I don't even need to use --trusted-host. If there was an issue with the certificate it would show up in the browser

              – Panagiotis Kanavos
              Apr 20 '18 at 14:38















              I did not say it is an issue with the certificate per se. The problem is that modern version of TLS require an upgrade of OpenSSL libraries. If your installation does not support TLS 1.2 you can't validate this kind of certificate.

              – GiulioP
              Apr 20 '18 at 15:01





              I did not say it is an issue with the certificate per se. The problem is that modern version of TLS require an upgrade of OpenSSL libraries. If your installation does not support TLS 1.2 you can't validate this kind of certificate.

              – GiulioP
              Apr 20 '18 at 15:01













              On second thought, since curl needs the --k (i.e. --insecure) option to succeed, there may be some proxy in the middle which is causing the issue. @Alexander, can you try to run tracert pypi.python.org on the cmd and see if anything weird comes up?

              – GiulioP
              Apr 20 '18 at 15:12





              On second thought, since curl needs the --k (i.e. --insecure) option to succeed, there may be some proxy in the middle which is causing the issue. @Alexander, can you try to run tracert pypi.python.org on the cmd and see if anything weird comes up?

              – GiulioP
              Apr 20 '18 at 15:12













              I get a couple hops and then the request all begin timing out I never reach the destination.

              – Alexander
              Apr 20 '18 at 16:34





              I get a couple hops and then the request all begin timing out I never reach the destination.

              – Alexander
              Apr 20 '18 at 16:34




              1




              1





              Using Python 2.7 I was having a similar issue but with Python 2.7.13 it works, thus the last number (known as micro version) actually matters. With 3.6.1 it works as well, so if you are using Python 3.6 you may wish to try 3.6.1 instead.

              – GiulioP
              Apr 24 '18 at 12:34







              Using Python 2.7 I was having a similar issue but with Python 2.7.13 it works, thus the last number (known as micro version) actually matters. With 3.6.1 it works as well, so if you are using Python 3.6 you may wish to try 3.6.1 instead.

              – GiulioP
              Apr 24 '18 at 12:34













              0














              I had the same proplem and I solved it during the installation of tensorflow. Here is the solution in steps:




              1. Access the file relevant to SSL. Find the folder in the install location, where sessions.py is located. (I guess it is in folder ~~~₩pip₩vender₩requests)


              2. Open sessions.py and modify self.verify = True to self.verify = False



              3. Install using trusted host code as below



                pip install --trusted-host pypi.org --trusted-host files.pythonhosted.org <package name> 







              share|improve this answer






























                0














                I had the same proplem and I solved it during the installation of tensorflow. Here is the solution in steps:




                1. Access the file relevant to SSL. Find the folder in the install location, where sessions.py is located. (I guess it is in folder ~~~₩pip₩vender₩requests)


                2. Open sessions.py and modify self.verify = True to self.verify = False



                3. Install using trusted host code as below



                  pip install --trusted-host pypi.org --trusted-host files.pythonhosted.org <package name> 







                share|improve this answer




























                  0












                  0








                  0







                  I had the same proplem and I solved it during the installation of tensorflow. Here is the solution in steps:




                  1. Access the file relevant to SSL. Find the folder in the install location, where sessions.py is located. (I guess it is in folder ~~~₩pip₩vender₩requests)


                  2. Open sessions.py and modify self.verify = True to self.verify = False



                  3. Install using trusted host code as below



                    pip install --trusted-host pypi.org --trusted-host files.pythonhosted.org <package name> 







                  share|improve this answer















                  I had the same proplem and I solved it during the installation of tensorflow. Here is the solution in steps:




                  1. Access the file relevant to SSL. Find the folder in the install location, where sessions.py is located. (I guess it is in folder ~~~₩pip₩vender₩requests)


                  2. Open sessions.py and modify self.verify = True to self.verify = False



                  3. Install using trusted host code as below



                    pip install --trusted-host pypi.org --trusted-host files.pythonhosted.org <package name> 








                  share|improve this answer














                  share|improve this answer



                  share|improve this answer








                  edited Sep 12 '18 at 1:53









                  scopchanov

                  3,67291942




                  3,67291942










                  answered Sep 12 '18 at 1:20









                  Soohan KimSoohan Kim

                  1




                  1























                      -1














                      Best solution i felt is:-
                      Access the file relevant to SSL. Find the folder in the install location, where sessions.py is located. (I guess it is in folder ~~~₩pip₩vender₩requests)



                      Open sessions.py and modify self.verify = True to self.verify = False



                      Install using trusted host code as below






                      share|improve this answer



















                      • 1





                        This answer seems incomplete. Where is the code in "Install using trusted host code as below"?

                        – Samuel Liew
                        Nov 14 '18 at 1:04
















                      -1














                      Best solution i felt is:-
                      Access the file relevant to SSL. Find the folder in the install location, where sessions.py is located. (I guess it is in folder ~~~₩pip₩vender₩requests)



                      Open sessions.py and modify self.verify = True to self.verify = False



                      Install using trusted host code as below






                      share|improve this answer



















                      • 1





                        This answer seems incomplete. Where is the code in "Install using trusted host code as below"?

                        – Samuel Liew
                        Nov 14 '18 at 1:04














                      -1












                      -1








                      -1







                      Best solution i felt is:-
                      Access the file relevant to SSL. Find the folder in the install location, where sessions.py is located. (I guess it is in folder ~~~₩pip₩vender₩requests)



                      Open sessions.py and modify self.verify = True to self.verify = False



                      Install using trusted host code as below






                      share|improve this answer













                      Best solution i felt is:-
                      Access the file relevant to SSL. Find the folder in the install location, where sessions.py is located. (I guess it is in folder ~~~₩pip₩vender₩requests)



                      Open sessions.py and modify self.verify = True to self.verify = False



                      Install using trusted host code as below







                      share|improve this answer












                      share|improve this answer



                      share|improve this answer










                      answered Nov 14 '18 at 0:48









                      Raviteja MinamanurRaviteja Minamanur

                      1




                      1








                      • 1





                        This answer seems incomplete. Where is the code in "Install using trusted host code as below"?

                        – Samuel Liew
                        Nov 14 '18 at 1:04














                      • 1





                        This answer seems incomplete. Where is the code in "Install using trusted host code as below"?

                        – Samuel Liew
                        Nov 14 '18 at 1:04








                      1




                      1





                      This answer seems incomplete. Where is the code in "Install using trusted host code as below"?

                      – Samuel Liew
                      Nov 14 '18 at 1:04





                      This answer seems incomplete. Where is the code in "Install using trusted host code as below"?

                      – Samuel Liew
                      Nov 14 '18 at 1:04


















                      draft saved

                      draft discarded




















































                      Thanks for contributing an answer to Stack Overflow!


                      • Please be sure to answer the question. Provide details and share your research!

                      But avoid



                      • Asking for help, clarification, or responding to other answers.

                      • Making statements based on opinion; back them up with references or personal experience.


                      To learn more, see our tips on writing great answers.




                      draft saved


                      draft discarded














                      StackExchange.ready(
                      function () {
                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f49943410%2fpip-ssl-error-on-windows%23new-answer', 'question_page');
                      }
                      );

                      Post as a guest















                      Required, but never shown





















































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown

































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown







                      Popular posts from this blog

                      Florida Star v. B. J. F.

                      Danny Elfman

                      Retrieve a Users Dashboard in Tumblr with R and TumblR. Oauth Issues