31
> 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?

fuesika
  • 3,280
  • 6
  • 26
  • 34
daydreamer
  • 87,243
  • 191
  • 450
  • 722
  • This looks like a network configuration/environment configuration issue, I just ran `pip install yolk` and everything workout out fine... Are you sure the machine has a connection to the internet... What happens when you ping google? – John Jul 02 '13 at 03:42
  • May be this makes clear.... https://github.com/mvantellingen/localshop/issues/34 and https://github.com/mvantellingen/localshop/pull/35 – Zangetsu Jul 02 '13 at 03:51

17 Answers17

19

I used to use the easy_install pip==1.2.1 workaround but I randomly found that if you're having this bug, you probably installed a 32bit version of python on a 64bit machine.

In short : If you install a 64bit version of it by installing it from the source and then build your virtualenv upon it, you wont have that pip bug anymore.

Statham
  • 4,000
  • 2
  • 32
  • 45
lapin
  • 2,098
  • 2
  • 21
  • 30
  • 4
    This is the real issue/solution and should be marked as the right answer! – miu Sep 11 '14 at 09:31
  • 1
    Can verify on Mac OSX. Accidental install of the "Mac OS X 32-bit i386/PPC installer" (python-x.x.x-macosx10.5.dmg) instead of the correct "Mac OS X 64-bit/32-bit installer" (python-x.x.x-macosx10.6.dmg) results in similar errors. Simply reinstalling the correct 64bit version fixes it. – Darian Moody Sep 11 '14 at 16:06
17

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.

iMitwe
  • 1,218
  • 16
  • 35
xinoman12
  • 311
  • 2
  • 10
  • 1
    Do you know the location where you would change this variable to get pip to work? thx – Aaron Lelevier Mar 16 '14 at 17:16
  • 3
    @AronYsidoro in /.pip/pip.conf Or if you are running pip as root, in: /root/.pip/pip.conf You can find a mirror without ssl here http://www.pypi-mirrors.org/ although, it's not the most secure solution :/ – hecvd May 06 '14 at 21:25
  • I have installed on windows and i am not able to instal anything using pip...How can i change the global value? Where can i find the file ? – Arindam Roychowdhury Jan 20 '16 at 11:37
  • I found the answer to my que: Its located in cmdoptions.py file in C:\Python27\Lib\site-packages\pip and C:\Python27\Lib\site-packages\pip\_vendor\distlib\locators.py – Arindam Roychowdhury Jan 20 '16 at 11:44
16

This is the full text of the blog post linked below:

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.

Alex Bitek
  • 6,529
  • 5
  • 47
  • 77
paulwithap
  • 678
  • 1
  • 7
  • 12
5

I faced the same issue and this error is because of 'Proxy Setting'. The syntax below helped me in resolving it successfully:

sudo pip --proxy=http://username:password@proxyURL:portNumber install yolk
Tshilidzi Mudau
  • 7,373
  • 6
  • 36
  • 49
Viv
  • 71
  • 1
  • 2
2

I had a similar problem with pip and easy_install:

Cannot fetch index base URL https://pypi.python.org/simple/

As suggested in the referenced blog post, there must be an issue with some older versions of OpenSSL being incompatible with pip 1.3.1.

Installing pip-1.2.1 is a working workaround.

Possibly related question.

[Edit]:

This definitely happens in RHEL/CentOS 4 distros

Glorfindel
  • 21,988
  • 13
  • 81
  • 109
Marios V
  • 1,174
  • 9
  • 15
  • 4
    Note that [link-only answers](http://meta.stackoverflow.com/tags/link-only-answers/info) are discouraged, SO answers should be the end-point of a search for a solution (vs. yet another stopover of references, which tend to get stale over time). Please consider adding a stand-alone synopsis here, keeping the link as a reference. – kleopatra Jan 24 '14 at 14:51
  • 2
    I'm the owner of the referenced site, and the blog is no longer up, but I have answered this question with the text from that post. – paulwithap Apr 03 '14 at 05:51
1

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.)

janos
  • 120,954
  • 29
  • 226
  • 236
  • Not true, because for me if I switch off network card and switch to wireless, which uses a less-firewalled network, it works; this happens 100% of time. – Oliver Aug 22 '14 at 19:06
  • I will check as soon as I get back to work on Tuesday. – Oliver Aug 29 '14 at 00:56
1

I had the same issue with pip 1.5.6.

I just deleted the ~/.pip folder and it worked like a charm.

rm -r ~/.pip/
GusC
  • 249
  • 2
  • 8
1

This has happened to my because of proxy-authntication, so I did this to resolve it

export http_proxy=http://uname:password@proxy.domain.com:8080
export https_proxy=http://uname:password@proxy.domain.com:8080
export ftp_proxy=http://uname:password@proxy.domain.com:8080
A.Zaben
  • 675
  • 6
  • 10
1

On Virtualenv try editing the pip file, like so:

vi <your_virtualenv_folder>/bin/pip

look at the first line and check if it corresponds to the project folder, if not just change it.

#!/<your_path>/<project_folder>/<your_virtualenv_folder>/bin/python
Slipstream
  • 13,455
  • 3
  • 59
  • 45
0

pip has mirror support

pip --use-mirrors install yolk

As of version 1.5, this option will be removed:

1.5 (unreleased)

BACKWARD INCOMPATIBLE pip no longer supports the --use-mirrors, -M, and --mirrors flags. The mirroring support has been removed. In order to use a mirror specify it as the primary index with -i or --index-url, or as an additional index with --extra-index-url. (Pull #1098, CVE-2013-5123)

BACKWARD INCOMPATIBLE pip no longer will scrape insecure external urls by default nor will it install externally hosted files by default. Users may opt into installing externally hosted or insecure files or urls using --allow-external PROJECT and --allow-insecure PROJECT. (Pull #1055)

Added colors to the logging output in order to draw attention to important warnings and errors. (Pull #1109)

Added warnings when using an insecure index, find-link, or dependency link. (Pull #1121)

Burhan Khalid
  • 169,990
  • 18
  • 245
  • 284
  • Hm, where'd you get that flag from? I'm pretty sure it's invalid. – mustafa.0x Aug 29 '13 at 11:02
  • From the [documentation](http://www.pip-installer.org/en/latest/configuration.html#mirror-support) – Burhan Khalid Aug 29 '13 at 11:24
  • `--user-mirrors` isn't mentioned — maybe the document has changed? – mustafa.0x Aug 29 '13 at 11:57
  • 1
    Yes, it has. It was [removed in 1.5](http://www.pip-installer.org/en/latest/news.html#unreleased) The alternative is listed at that page. Note: this is an unreleased version. The latest stable version has the option enabled. – Burhan Khalid Aug 29 '13 at 12:11
0

Your system clock is likely set in the past.Check the time using the date command and set it right

Chetan
  • 1,217
  • 2
  • 13
  • 27
0

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
Tim
  • 10,459
  • 4
  • 36
  • 47
geographika
  • 6,458
  • 4
  • 38
  • 56
0

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

Armo
  • 1
0

I had that problem too, after I tried to reset my network settings. it solves problem.

ZijiG
  • 21
  • 1
0

You just need to upgrade the pip

pip install --index-url https://pypi.python.org/simple/ --upgrade pip
Hansamal
  • 39
  • 4
-1

For me it worked a simple sudo pip -I install <package>.

As man pip states, -I ignores installed packages, forcing reinstall instead.

Patrizio Bertoni
  • 2,582
  • 31
  • 43
-2

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.

jspy
  • 1