I am trying to use pip behind a proxy at work.
One of the answers from this post suggested using CNTLM. I installed and configured it per this other post, but runnin
To setup CNTLM for windows, follow this article. For Ubuntu, read my blog post.
Edit:
Basically, to use CNTLM in any platform, you need to setup your username and hashed password, before using http://127.0.0.1:3128
as a proxy to your parent proxy.
Edit the config and add important information like domain, username, password and parent proxy.
Generate hashed password.
Windows cntlm –c cntlm.ini –H
Ubuntu/Linux cntlm -v -H -c /etc/cntlm.conf
Remove plain text password from the config and replace them with the generated passwords.
To check if working:
Windows cntlm –M http://www.google.com
Ubuntu/Linux sudo cntlm -M http://www.google.com/
For more detailed instructions, see links above.
Update:
Just for completeness sake, I was able to configure and use CNTLM in Windows recently. I encountered a problem during the syncing process of Kindle for PC because of our proxy and installing and configuring CNTLM for Windows fixed that issue for me. Refer to my article for more details.
How about just doing it locally? Most likely you are able to download from https source through your browser
Extract it and go the extracted dir where setup.py is located and call:
C:\mysql-connector-python-2.0.3>python.exe setup.py install
With Ubuntu I could not get the proxy option to work as advertised – so following command did not work:
sudo pip --proxy http://web-proxy.mydomain.com install somepackage
But exporting the https_proxy
environment variable (note its https_proxy
not http_proxy
) did the trick:
export https_proxy=http://web-proxy.mydomain.com
then
sudo -E pip install somepackage
It was not working for me. I had to use https at work:
pip install --proxy=https://user@mydomain:port somepackage
In order to update, add -U.
Warning, there is something very bad with the "pip search" command. The search command do not use the proxy setting regardless of the way it's being passed.
I was trying to figure out the problem only trying the "search" command, and found this post with detailed explanation about that bug: https://github.com/pypa/pip/issues/1104
I can confirm the bug remains with pip 1.5.6 on Debian 8 with python 2.7.9. The "pip install" command works like a charm.
Set up invironment variable in Advanced System Settings. In Command prompt it should behave like this :
C:\Windows\system32>echo %http_proxy%
http://username:passowrd@proxy:port
C:\Windows\system32>echo %https_proxy%
http://username:password@proxy:port
Later , Simply
pip install whatEver
should work.