Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

pip issue installing almost any library

I have a difficult time using pip to install almost anything. I'm new to coding, so I thought maybe this is something I've been doing wrong and have opted out to easy_install to get most of what I needed done, which has generally worked. However, now I'm trying to download the nltk library, and neither is getting the job done.

I tried entering

sudo pip install nltk 

but got the following response:

/Library/Frameworks/Python.framework/Versions/2.7/bin/pip run on Sat May  4 00:15:38 2013 Downloading/unpacking nltk    Getting page https://pypi.python.org/simple/nltk/   Could not fetch URL [need more reputation to post link]: There was a problem confirming the ssl certificate: <urlopen error [Errno 1] _ssl.c:504: error:0D0890A1:asn1 encoding routines:ASN1_verify:unknown message digest algorithm>    Will skip URL [need more reputation to post link]/simple/nltk/ when looking for download links for nltk    Getting page [need more reputation to post link]/simple/   Could not fetch URL https://pypi.python. org/simple/: There was a problem confirming the ssl certificate: <urlopen error [Errno 1] _ssl.c:504: error:0D0890A1:asn1 encoding routines:ASN1_verify:unknown message digest algorithm>    Will skip URL [need more reputation to post link] when looking for download links for nltk    Cannot fetch index base URL [need more reputation to post link]    URLs to search for versions for nltk:   * [need more reputation to post link]   Getting page [need more reputation to post link]   Could not fetch URL [need more reputation to post link]: There was a problem confirming the ssl certificate: <urlopen error [Errno 1] _ssl.c:504: error:0D0890A1:asn1 encoding routines:ASN1_verify:unknown message digest algorithm>    Will skip URL [need more reputation to post link] when looking for download links for nltk    Could not find any downloads that satisfy the requirement nltk  No distributions at all found for nltk  Exception information: Traceback (most recent call last):   File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pip-1.3.1-py2.7.egg/pip/basecommand.py", line 139, in main     status = self.run(options, args)   File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pip-1.3.1-py2.7.egg/pip/commands/install.py", line 266, in run     requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundle=self.bundle)   File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pip-1.3.1-py2.7.egg/pip/req.py", line 1026, in prepare_files     url = finder.find_requirement(req_to_install, upgrade=self.upgrade)   File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pip-1.3.1-py2.7.egg/pip/index.py", line 171, in find_requirement     raise DistributionNotFound('No distributions at all found for %s' % req) DistributionNotFound: No distributions at all found for nltk  --easy_install installed fragments of the library and the code ran into trouble very quickly upon trying to run it. 

Any thoughts on this issue? I'd really appreciate some feedback on how I can either get pip working or something to get around the issue in the meantime.

like image 522
contentclown Avatar asked May 04 '13 04:05

contentclown


People also ask

Does pip install packages or libraries?

pip is the preferred installer program. Starting with Python 3.4, it is included by default with the Python binary installers. A virtual environment is a semi-isolated Python environment that allows packages to be installed for use by a particular application, rather than being installed system wide.

How do you fix error you must give at least one requirement to install see pip help install?

You must give at least one requirement to install (see "pip help install") You are using pip version 9.0. 1, however version 9.0. 3 is available. You should consider upgrading via the 'python -m pip install --upgrade pip' command.


1 Answers

I found it sufficient to specify the pypi host as trusted. Example:

pip install --trusted-host pypi.python.org pytest-xdist pip install --trusted-host pypi.python.org --upgrade pip 

This solved the following error:

  Could not fetch URL https://pypi.python.org/simple/pytest-cov/: There was a problem confirming the ssl certificate: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:600) - skipping   Could not find a version that satisfies the requirement pytest-cov (from versions: ) No matching distribution found for pytest-cov 

Update April 2018: To anyone getting the TLSV1_ALERT_PROTOCOL_VERSION error: it has nothing to do with trusted-host/verification issue of the OP or this answer. Rather the TLSV1 error is because your interpreter does not support TLS v1.2, you must upgrade your interpreter. See for example https://news.ycombinator.com/item?id=13539034, http://pyfound.blogspot.ca/2017/01/time-to-upgrade-your-python-tls-v12.html and https://bugs.python.org/issue17128.

Update Feb 2019: For some it may be sufficient to upgrade pip. If the above error prevents you from doing this, use get-pip.py. E.g. on Linux,

curl https://bootstrap.pypa.io/get-pip.py sudo python get-pip.py 

More details at https://pip.pypa.io/en/stable/installing/.

like image 174
Oliver Avatar answered Sep 20 '22 14:09

Oliver