I am very new to Python and trying to > pip install linkchecker
on Windows 7. Some notes:
- pip install is failing no matter the package. For example,
> pip install scrapy
also results in the SSL error. - Vanilla install of Python 3.4.1 included pip 1.5.6. The first thing I tried to do was install linkchecker. Python 2.7 was already installed, it came with ArcGIS.
python
andpip
were not available from the command line until I installed 3.4.1. > pip search linkchecker
works. Perhaps that is because pip search does not verify the site's SSL certificate.- I am in a company network but we do not go through a proxy to reach the Internet.
- Each company computer (including mine) has a Trusted Root Certificate Authority that is used for various reasons including enabling monitoring TLS traffic to https://google.com. Not sure if that has anything to do with it.
Here are the contents of my pip.log after running pip install linkchecker
:
Downloading/unpacking linkchecker
Getting page https://pypi.python.org/simple/linkchecker/
Could not fetch URL https://pypi.python.org/simple/linkchecker/: connection error: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:598)
Will skip URL https://pypi.python.org/simple/linkchecker/ when looking for download links for linkchecker
Getting page https://pypi.python.org/simple/
Could not fetch URL https://pypi.python.org/simple/: connection error: HTTPSConnectionPool(host='pypi.python.org', port=443): Max retries exceeded with url: /simple/ (Caused by <class 'http.client.CannotSendRequest'>: Request-sent)
Will skip URL https://pypi.python.org/simple/ when looking for download links for linkchecker
Cannot fetch index base URL https://pypi.python.org/simple/
URLs to search for versions for linkchecker:
* https://pypi.python.org/simple/linkchecker/
Getting page https://pypi.python.org/simple/linkchecker/
Could not fetch URL https://pypi.python.org/simple/linkchecker/: connection error: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:598)
Will skip URL https://pypi.python.org/simple/linkchecker/ when looking for download links for linkchecker
Could not find any downloads that satisfy the requirement linkchecker
Cleaning up...
Removing temporary dir C:\Users\jcook\AppData\Local\Temp\pip_build_jcook...
No distributions at all found for linkchecker
Exception information:
Traceback (most recent call last):
File "C:\Python34\lib\site-packages\pip\basecommand.py", line 122, in main
status = self.run(options, args)
File "C:\Python34\lib\site-packages\pip\commands\install.py", line 278, in run
requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundle=self.bundle)
File "C:\Python34\lib\site-packages\pip\req.py", line 1177, in prepare_files
url = finder.find_requirement(req_to_install, upgrade=self.upgrade)
File "C:\Python34\lib\site-packages\pip\index.py", line 277, in find_requirement
raise DistributionNotFound('No distributions at all found for %s' % req)
pip.exceptions.DistributionNotFound: No distributions at all found for linkchecker
You've the following possibilities to solve issue with
CERTIFICATE_VERIFY_FAILED
:Use
--cert <trusted.pem>
orCA_BUNDLE
variable to specify alternative CA bundle.E.g. you can go to failing URL from web-browser and import root certificate into your system.
Run
python -c "import ssl; print(ssl.get_default_verify_paths())"
to check the current one (validate if exists).SSL_CERT_DIR
,SSL_CERT_FILE
) which can be used to specify different certificate databasePEP-476.--trusted-host <hostname>
to mark the host as trusted.verify=False
forrequests.get
(see: SSL Cert Verification).--proxy <proxy>
to avoid certificate checks.Read more at: TLS/SSL wrapper for socket objects - Verifying certificates.
Had the same problem trying
pip install ftputil
with ActivePython 2.7.8, ActivePython 3.4.1, and "stock" Python 3.4.2 on 64-bit Windows 7 Enterprise. All attempts failed with the same errors as OP.Worked around the problem for Python 3.4.2 by downgrading to pip 1.2.1:
easy_install pip==1.2.1
(see https://stackoverflow.com/a/16370731/234235). Same fix also worked for ActivePython 2.7.8.The bug, reported in March 2013, is still open: https://github.com/pypa/pip/issues/829.
You can try this to ignore "https":
Set Time and Date correct!
Mabey I'm a bit late to answer,
For me, it came out that my date and time was misconfigured on Raspberry Pi. The result was that all SSL and HTTPS connections failed, using the https://files.pythonhosted.org/ server.
Update it like this:
You have 4 options:
Using a certificate as parameter
Using a certificate in a
pip.conf
Create this file:
and add these lines:
Ignoring certificate and using HTTP
Ignoring certificate and using HTTP in a pip.conf
Create this file:
and add these lines:
Source
One solution (for Windows) is to create a file called
pip.ini
on the%AppData%\pip\
folder (create the folder if it doesn't exist) and insert the following details:...and then we can execute the install instruction:
Another option is to install the package using arguments for the proxy and certificate...
To convert the certificate
*.cer
files to the required*.pem
format execute the following instruction:Hope this helps someone!