Thursday, March 6, 2014

Installing python modules with setuptools or pip

Remember to set your http (and https) proxy!


Running into errors like this:
sudo pip install nose
Cannot fetch index base URL http://pypi.python.org/simple/

Or this:
sudo easy_install nose
Scanning index of all packages (this may take a while)
Reading http://pypi.python.org/simple/
Download error: [Errno -2] Name or service not known -- Some packages may not be found!

Is simply a matter of setting your http proxy because PYPI redirects to https. Check your environment by:
env | grep -i http

If it returns empty, nothing has been set. Set them using:
set http_proxy=http://localhost:8080
set https_proxy=http://localhost:8080

And it should now work.

No comments:

Post a Comment