Jacob Tomlinson's profile picture Jacob Tomlinson
Home Blog Talks About

How to easy_install and pip through a proxy

1 minute read #python, #easy_install, #pip, #proxy

If you’re trying to install a Python package using easy_install or pip and you connect to the internet via a proxy you’ll need to make a few changes to your setup.

easy_install

easy_install requires you set the http_proxy and https_proxy environment variables. You can either run the following commands in a terminal or add them to your .bashrc.

export http_proxy=http://proxy_url:proxy_port
export https_proxy=http://proxy_url:proxy_port

pip

pip should follow the same rules as above, so you can specify the proxy config in your environment variables.

However it also supports a --proxy flag if you want to specify it manually.

pip install --proxy=http://proxy_url:proxy_port package

Have thoughts?

I love hearing feedback on my posts. You should head over to Twitter and let me know what you think!

Spotted a mistake? Why not suggest an edit!