3

I've installed python 3.4.3 which comes with pip. I want to use pip from behind a proxy so I did the following:

Created C:\Users\foo\pip\pip.ini and added a proxy configuration section:

[proxy]
export http_proxy=my_proxy_server:1234

However, when I try to run pip to install packages, I get timeout messages:

C:\Users\foo>pip install paramiko Requirement already satisfied (use --upgrade to upgrade): paramiko in c:\python3 4\lib\site-packages\paramiko-1.16.0-py3.4.egg Collecting pycrypto!=2.4,>=2.1 (from paramiko) Retrying (Retry(total=4, connect=None, read=None, redirect=None)) after connec tion broken by 'ConnectTimeoutError(, 'Connection to pypi.python. org timed out. (connect timeout=15)')': /simple/pycrypto/

Any ideas what I'm doing wrong?

Thanks in Adv.!

Pat Mustard
  • 1,852
  • 9
  • 31
  • 58

2 Answers2

6

You can use the following command so that pip uses your proxy. The basic format is of this form:

 [user:passwd@]proxy.server:port

For example:

pip --proxy http://<your proxy>:<your port> (for http)
pip --proxy https://<your proxy>:<your port> (for https)
Arpit Goyal
  • 2,212
  • 11
  • 31
  • Thanks, Arpri. This seems to get me one step further but now I get this: "Could not find any downloads that satisfy the requirement pycrypto!=2.4,>=2.1 (from paramiko) No distributions at all found for pycrypto!=2.4,>=2.1 (from paramiko)" – Pat Mustard Aug 03 '15 at 09:48
  • @Arpit Goyal Can this settings be saved in pip.ini file? – Wlad Apr 18 '17 at 12:02
  • you can check in pip's documentation the portion about config file https://pip.pypa.io/en/stable/user_guide/#config-file – Arpit Goyal Apr 18 '17 at 12:28
3

You can set the proxy in "/etc/pip.conf":

[global]
proxy = http://host:port
xmduhan
  • 965
  • 12
  • 14