Proxy settings for pip-Win
You can enter proxy settings within pip-Win, as follows :
pip install pyDatalog --proxy username:password@myproxy:myproxyport
where you replace username, password, myproxy
and myproxyport
by relevant data.
However, this assumes that your python interpreter already has pip properly installed. If this is not the case, you can create a .bat file that will launch pip-Win with appropriate proxy settings, as follows:
- download the latest version of pip-Win
- download get-pip.py
- create a
pipwin.bat
file in the directory where you downloaded pip-Win, with the following content.
set HTTP_PROXY=http://DOMAIN\username:password@myproxy:myproxyport
set HTTPS_PROXY=https://DOMAIN\username:password@myproxy:myproxyport
path\to\python.exe path\to\get-pip.py
path\to\pip-win_1.6.exe
- update the lines in pipwin.bat with your data as appropriate. Remove DOMAIN\username:password@ if your proxy does not require authentication. For example :
set HTTP_PROXY=http://
192.168.0.40:8080
set HTTPS_PROXY=https://192.168.0.40:8080
c:\python27\python.exe c:\downloads\get-pip.py
c:\python\pip-win_1.6.exe
- run the pipwin.bat file : pip-Win should now launch without error.
Important Caveats
- Do not issue the
upgrade
command, as it may break pip. - python programs run from pip-win will not benefit from the proxy settings.
You don't need to repeat your proxy settings when issuing pip install xyz
commands.
Security Note
If you do not want to have your username and password stored in the batch file, which is understandable, you can type the commands above in a DOS command prompt. However, you'll have to re-type all 3 statements whenever you want to start pip-Win.