Error while installing with Python “pip”: Cannot f

2019-02-06 13:06发布

I am trying to install a local version of ScrumDo for testing. Only then I come to the point in my installation that I have to run:

source bin/activate
pip install -r requirements.txt

I get the error:

Downloading/unpacking django-storages

Cannot fetch index base URL http : //b.pypi.python.org/simple/
Could not find any downloads that satisfy the requirement django-storages

No distributions at all found for django-storages
Storing complete log in ./pip-log.txt

I googled a bit and search here and on Stack Overflow and found that I should add a --proxy= option and/or unset my http_proxy environment variable. Yet my install does not have a proxy and the environment var is not set. I tried running

pip install -r requirements.txt --proxy=

Yet the error remains the same. I also created a /root/.pip/pip.conf containing:

[global]
index-url = http : //b.pypi.python.org/simple

and checked it the server actually was online and if the package django-storages existed, this was both true.

a last thing I tried, since the install doc of ScrumDo says so:

pip install -U Django==1.1.4

yet again no succes... the error always remains the same, any one got any Ideas?

my pip-error.log shows the following (the URL works in firefox on a different machine in the same network that also uses no proxy, and I can ping it from the same machine):

/var/www/ScrumDo/pinax-env/bin/pip run on Mon Jul 30 10:24:08 2012
proxy):

Downloading/unpacking Django==1.1.4
proxy):

  Getting page http://b.pypi.python.org/simple/Django
proxy):

  Could not fetch URL http://b.pypi.python.org/simple/Django: HTTP Error 404: Not Found
proxy):

  Will skip URL http://b.pypi.python.org/simple/Django when looking for download links for Django==1.1.4
proxy):

  Getting page http://b.pypi.python.org/simple/
proxy):

  Could not fetch URL http://b.pypi.python.org/simple/: HTTP Error 404: Not Found
proxy):

  Will skip URL http://b.pypi.python.org/simple/ when looking for download links for Django==1.1.4
proxy):

  Cannot fetch index base URL http://b.pypi.python.org/simple/
proxy):

  URLs to search for versions for Django==1.1.4:
proxy):

  * http://b.pypi.python.org/simple/Django/1.1.4
proxy):

  * http://b.pypi.python.org/simple/Django/
proxy):

  Getting page http://b.pypi.python.org/simple/Django/1.1.4
proxy):

  Getting page http://b.pypi.python.org/simple/Django/
proxy):

  Could not fetch URL http://b.pypi.python.org/simple/Django/1.1.4: HTTP Error 404: Not Found
proxy):

  Will skip URL http://b.pypi.python.org/simple/Django/1.1.4 when looking for download links for Django==1.1.4
proxy):

  Could not fetch URL http://b.pypi.python.org/simple/Django/: HTTP Error 404: Not Found
proxy):

  Will skip URL http://b.pypi.python.org/simple/Django/ when looking for download links for Django==1.1.4
proxy):

  Could not find any downloads that satisfy the requirement Django==1.1.4
No distributions at all found for Django==1.1.4
proxy):

Exception information:
proxy):

Traceback (most recent call last):
  File "/var/www/ScrumDo/pinax-env/lib/python2.6/site-packages/pip-0.6.1-py2.6.egg/pip.py", line 482, in main
proxy):

    self.run(options, args)
proxy):

  File "/var/www/ScrumDo/pinax-env/lib/python2.6/site-packages/pip-0.6.1-py2.6.egg/pip.py", line 675, in run
proxy):

    requirement_set.install_files(finder, force_root_egg_info=self.bundle)
proxy):

  File "/var/www/ScrumDo/pinax-env/lib/python2.6/site-packages/pip-0.6.1-py2.6.egg/pip.py", line 2422, in install_files
proxy):

    url = finder.find_requirement(req_to_install, upgrade=self.upgrade)
proxy):

proxy):

  File "/var/www/ScrumDo/pinax-env/lib/python2.6/site-packages/pip-0.6.1-py2.6.egg/pip.py", line 1485, in find_requirement
proxy):

proxy):

    raise DistributionNotFound('No distributions at all found for %s' % req)
proxy):


proxy):

DistributionNotFound: No distributions at all found for Django==1.1.4

4条回答
老娘就宠你
2楼-- · 2019-02-06 13:44

Try giving the proxy settings in the command as such

pip --proxy=http://user:password@Proxy:PortNumber install -r requirements.txt 

or try

export http_proxy=http://user:password@Proxy:PortNumber
查看更多
何必那么认真
3楼-- · 2019-02-06 13:45

If you've tried installing a package with pip recently, you may have encountered this error:

Could not fetch URL https://pypi.python.org/simple/Django/: 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 https://pypi.python.org/simple/Django/ when looking for download links for Django==1.5.1 (from -r requirements.txt (line 1))
  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 https://pypi.python.org/simple/ when looking for download links for Django==1.5.1 (from -r requirements.txt (line 1))
  Cannot fetch index base URL https://pypi.python.org/simple/
  Could not fetch URL https://pypi.python.org/simple/Django/1.5.1: 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 https://pypi.python.org/simple/Django/1.5.1 when looking for download links for Django==1.5.1 (from -r requirements.txt (line 1))
  Could not fetch URL https://pypi.python.org/simple/Django/: 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 https://pypi.python.org/simple/Django/ when looking for download links for Django==1.5.1 (from -r requirements.txt (line 1))
  Could not find any downloads that satisfy the requirement Django==1.5.1 (from -r requirements.txt (line 1))
No distributions at all found for Django==1.5.1 (from -r requirements.txt (line 1))
Storing complete log in /Users/paul/.pip/pip.log

This seems to be an issue with an old version of OpenSSL being incompatible with pip 1.3.1. If you're using a non-stock Python distribution (notably EPD 7.3), you're very likely to have a setup that isn't going to work with pip 1.3.1 without a shitload of work.

The easy workaround for now, is to install pip 1.2.1, which does not require SSL:

curl -o https://pypi.python.org/packages/source/p/pip/pip-1.2.1.tar.gz
tar xvfz pip-1.2.1.tar.gz
cd pip-1.2.1
python setup.py install

If you are using EPD, and you're not using it for a class where things might break, you may want to consider installing the new incarnation: Enthought Canopy. I know they were aware of the issues caused by the previous version of OpenSSL, and would imagine they are using a new version now that should play nicely with pip 1.3.1.

查看更多
神经病院院长
4楼-- · 2019-02-06 13:50

You can try installing django-storages on its own.. try this?

sudo pip install https://bitbucket.org/david/django-storages/get/def732408163.zip
查看更多
小情绪 Triste *
5楼-- · 2019-02-06 14:04

This problem is most-likely caused by DNS setup: server cannot resolve the Domain Name, so cannot download the package.

Solution: sudo nano /etc/network/interface

add a line: dns-nameservers 8.8.8.8

save file and exit

    sudo ifdown eth0 && sudo ifup eth0

Then pip install should be working now.

查看更多
登录 后发表回答