title: How to get pip to work behind a proxy server
body: <p>I am trying to use python package manager pip to install a package and it's dependencies from the internet. However I am behind a proxy in my college and have already set the <code>http_proxy</code> environment variable. But when I try to install a package like this:</p>
  
  <pre><code>pip install TwitterApi
  </code></pre>
  
  <p>I get this error in the log file:</p>
  
  <pre><code>Getting page http://pypi.python.org/simple/TwitterApi
  Could not fetch URL http://pypi.python.org/simple/TwitterApi: &lt;urlopen error [Errno 111] Connection refused&gt;
  Will skip URL http://pypi.python.org/simple/TwitterApi when looking for download links for TwitterApi
  Getting page http://pypi.python.org/simple/
  Could not fetch URL http://pypi.python.org/simple/: &lt;urlopen error [Errno 111] Connection refused&gt;
  </code></pre>
  
  <p>I even tried setting my proxy variable explicitly like this:</p>
  
  <pre><code>pip install --proxy http://user:password@proxyserver:port TwitterApi
  </code></pre>
  
  <p>But I still get the same error. How do I get pip to work behind a proxy server.</p>