I'm trying to install a Python pip package on Windows 10. Unfortunately, the proxy at my work is giving me trouble.
Things I've tried:
python -m pip install --proxy "http://sam.s1:1234@proxy.det.nsw.edu.au:8080"python -m pip install --proxy http://sam.s1:1234@proxy.det.nsw.edu.au:8080- & 2. with the protocol changed to https
- & 2. omitting the protocol, eg:
python -m pip install --proxy sam.s1:1234@proxy.det.nsw.edu.au:8080
- & 2. omitting the protocol, eg:
set HTTP_PROXY=sam.s1:1234@proxy.det.nsw.edu.au:8080set HTTPS_PROXY=%HTTP_PROXY%set FTP_PROXY=%HTTP_PROXY%- Editing the proxy address for the HTTP_PROXY env variable in the same way described in steps 1 to 4.
- Creating a pip.ini file at %APP_DATA%/pip/ with the following contents:
[global]
proxy = "http://sam.s1:1234@proxy.det.nsw.edu.au:8080"
trusted-host = pypi.python.org
- Editing the proxy address in the pip.ini file in the same way described in steps 1 to 4.
They all give me similar errors such as:
Retrying (Retry(total=0, connect=None, read=None, redirect=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', NewConnectionError('<pip._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x000002A6F091B080>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed',))': /simple/django/
and
Retrying (Retry(total=0, connect=None, read=None, redirect=None)) after connection broken by 'ConnectTimeoutError(<pip._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x000002142813B128>, 'Connection to pypi.python.org timed out. (connect timeout=15)')': /simple/django/
and
Retrying (Retry(total=0, connect=None, read=None, redirect=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', OSError('Tunnel connection failed: 407 Proxy Authentication Required',))': /simple/django/
Although sorting out once and for all how to download packages though the proxy would be nice, I'll settle for instructions on any methods that circumvent the proxy entirely, like downloading the package and compiling from source (I usually use Ubuntu, so I have no idea how to do this type of thing on Windows).
Other information:
- The proxy is configured via a pac script
- The package I'm currently trying to install is Django, but there will probably be others in the future.
- I installed pip when I installed Python 3.6.3 (via the checkbox that says something like, do you also want to install pip as well as Python).
- I know that pip is grabbing the settings from the .ini file, since I can change the output of
$ pip listby setting a value for[list].
$ python -m pip install Django-1.11.7.tar.gzCollecting pytz (from Django==1.11.7), which seems to be a timezone package Django requires, and then fails because of the proxy thing again. At least, with your way I can wait for it to fail installing a dependency, download and install the dependency through PyPI, then rinse and repeat. Not ideal, but nothing else seems to work.