Not satisfied by the Answer? Still have doubts?
Ask Question

Pip install fails with “connection error:

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 and pip were not available from the command line until I installed 3.4.1.

Here are the contents of my pip.log after running pip install linkchecker:
Downloading/unpacking linkchecker
Getting page //pypi.python.org/simple/linkchecker/
Could not fetch URL //pypi.python.org/simple/linkchecker/: connection error: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:598)
Will skip URL //pypi.python.org/simple/linkchecker/ when looking for download links for linkchecker
Getting page //pypi.python.org/simple/
Could not fetch URL //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 //pypi.python.org/simple/ when looking for download links for linkchecker
Cannot fetch index base URL //pypi.python.org/simple/
URLs to search for versions for linkchecker:
* //pypi.python.org/simple/linkchecker/
Getting page //pypi.python.org/simple/linkchecker/
Could not fetch URL //pypi.python.org/simple/linkchecker/: connection error: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:598)
Will skip URL //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:UsersjcookAppDataLocalTemppip_build_jcook...
No distributions at all found for linkchecker
Exception information:
Traceback (most recent call last):
File "C:Python34libsite-packagespipbasecommand.py", line 122, in main
status = self.run(options, args)
File "C:Python34libsite-packagespipcommandsinstall.py", line 278, in run
requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundle=self.bundle)
File "C:Python34libsite-packagespipreq.py", line 1177, in prepare_files
url = finder.find_requirement(req_to_install, upgrade=self.upgrade)
File "C:Python34libsite-packagespipindex.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
pip ssl windows
by

2 Answers

akshay1995
For me the problem was fixed by creating a folder pip, with a file: pip.ini in C:Users<username>AppDataRoaming e.g:

C:Users<username>AppDataRoamingpippip.ini

Inside it I wrote:

[global]
trusted-host = pypi.python.org
pypi.org
files.pythonhosted.org

I restarted python, and then pip permanently trusted these sites, and used them to download packages from.

If you can't find the AppData Folder on windows, write %appdata% in file explorer and it should appear.
sandhya6gczb
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 setuptools

Or by just reinstalling it to get the latest version:

Login / Signup to Answer the Question.

  • Be descriptive with your answer, and try to avoid copy-pasting external links, instead guide the user who has asked the question, where can they find the detailed answer.
  • You cannot share any URL in answer.
  • To make a text bold, surround the text with single asterisk, for example *bold text*
  • To format a text like code, surround the text within double asterisk, for example **code**
  • To add a multiline piece of code, surround the whole code within triple asterisk, for example *** multiline code ***
  • Please verify before submitting the answer.