[SOLVED] pip wont download anything, says no matching package – Certificate error

Recently met with this error, but failed to understand it was a network certificate issue. Pip tries to download source from the internet, and probably HTTPS will be handled by your CA Certificate, and – how would the download succeed?. This would be your scenario :

$ (env) pip install Django==1.6.0
Collecting Django==1.6.0
  Could not find any downloads that satisfy the requirement Django==1.6.0
  No distributions at all found for Django==1.6.0
(env)➜ 

Fix : Explicitly pass the certificate to pip. Considring you have certificate under /home/foo/CA_cert.cer

$ (env) pip --cert /home/foo/CA_cert.cerr install Django==1.6.0
Collecting Django==1.6.0
  Downloading Django-1.6-py2.py3-none-any.whl (6.7MB)

Here you go :). If you have your requirements in a file requirements.txt

$ (env) pip --cert /home/foo/CA_cert.cerr install -r requirements.txt

fun!

Advertisements

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s