Saturday, July 7, 2012

Python easy_install proxy settings

Python easy_install may not take in the http_proxy environment variable.

It's a problem with sudo. If you use sudo, the variable $http_proxy is unknown in this context.

"sudo -i" opens up a root shell. There you can set the $http_proxy variable again and then easy_install works - you don't have to use sudo because you are already superuser.
$ sudo -i
# export http_proxy=http://proxy:port
# easy_install virtualenv

Or you can have your actual environment in sudo and the save the "get root step" via:
$ sudo -E easy_install virtualenv
References:
http://superuser.com/questions/258819/easy-install-will-not-connect-through-proxy

1 comment: