pip cannot install anything

2019-01-13 10:35发布

> pip install yolk
Downloading/unpacking yolk
  Cannot fetch index base URL https://pypi.python.org/simple/
  Could not find any downloads that satisfy the requirement yolk
No distributions at all found for yolk
Storing complete log in /Users/harith/.pip/pip.log

when I read the file I see

> cat /Users/harith/.pip/pip.log
------------------------------------------------------------
/Users/harith/.shared/virtualenvs/pennytracker/bin/pip run on Mon Jul  1 20:26:02 2013
Downloading/unpacking yolk

  Getting page https://pypi.python.org/simple/yolk/
  Could not fetch URL https://pypi.python.org/simple/yolk/: HTTP Error 503: Service Unavailable
  Will skip URL https://pypi.python.org/simple/yolk/ when looking for download links for yolk
  Getting page https://pypi.python.org/simple/
  Could not fetch URL https://pypi.python.org/simple/: HTTP Error 503: Service Unavailable
  Will skip URL https://pypi.python.org/simple/ when looking for download links for yolk
  Cannot fetch index base URL https://pypi.python.org/simple/

  URLs to search for versions for yolk:
  * https://pypi.python.org/simple/yolk/
  Getting page https://pypi.python.org/simple/yolk/
  Could not fetch URL https://pypi.python.org/simple/yolk/: HTTP Error 503: Service Unavailable
  Will skip URL https://pypi.python.org/simple/yolk/ when looking for download links for yolk
  Could not find any downloads that satisfy the requirement yolk

No distributions at all found for yolk

    Exception information:
    Traceback (most recent call last):
      File "/Users/harith/.shared/virtualenvs/pennytracker/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 "/Users/harith/.shared/virtualenvs/pennytracker/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 "/Users/harith/.shared/virtualenvs/pennytracker/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 "/Users/harith/.shared/virtualenvs/pennytracker/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 yolk

Am i doing anything wrong?

标签: python pip
16条回答
爷、活的狠高调
2楼-- · 2019-01-13 11:15

In my case the https port (443) wasn't open so my firewall blocked all traffic and pip couldn't download the packages.

查看更多
萌系小妹纸
3楼-- · 2019-01-13 11:16

I had this error message occur as I had set a Windows Environment Variable to an invalid certificate file.

Check if you have a CURL_CA_BUNDLE variable by typing SET at the command prompt.

You can override it for the current session with SET CURL_CA_BUNDLE=

The pip.log contained the following:

Getting page https://pypi.python.org/simple/pip/
Could not fetch URL https://pypi.python.org/simple/pip/: connection error: [Errno 185090050] _ssl.c:340: error:0B084002:x509 certificate routines:X509_load_cert_crl_file:system lib
查看更多
该账号已被封号
4楼-- · 2019-01-13 11:17

The explanation is in your logs:

Could not fetch URL https://pypi.python.org/simple/yolk/: HTTP Error 503: Service Unavailable

Notice the HTTP Error 503: Service Unavailable. It seems the site was down when you were trying to do this.

It's good to know that HTTP 5xx errors are server side errors, so you can know the problem was not in your local network but in the remote network.

It means try again later ;-) (and cross fingers...) (It works for me now btw.)

查看更多
老娘就宠你
5楼-- · 2019-01-13 11:19

It's because in the pip configuration the index-url parameter should point to the new pypi url. Change the file in ~/.pip/pip.conf or if you are running pip as root, in: /root/.pip/pip.conf.

Probably you have this:

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

You shoudl change it for this:

  [global]
  index-url=https://pypi.python.org/pypi/

And then all should work as before. I hope it helps you.

查看更多
登录 后发表回答