My setup:
apt-get install
works as wellHere's what I've done to configure the proxy up to this point:
/etc/profile.d/proxy.sh:
export http_proxy="http://<my_proxy>:<my_port>"
export https_proxy="http://<my_proxy>:<my_port>"
export ftp_proxy="http://<my_proxy>:<my_port>"
To get aptitude to work, modified /etc/apt/apt.conf.d/01proxy:
Acquire::http::Proxy “http://<my_proxy>:<my_port>"
To keep the env vars around when using sudo, modified /etc/sudoers.d/proxy:
Defaults env_keep += "http_proxy https_proxy ftp_proxy"
I've also set the HTTP/HTTPS/FTP Proxy settings in Settings->Network->NetWork Proxy, and clicked "Apply system wide".
The problem is that when I try pip install
(with or without sudo
), it fails with the error:
$ pip -vv install git-review
Downloading/unpacking git-review
Getting page http://pypi.python.org/simple/git-review
Could not fetch URL http://pypi.python.org/simple/git-review: <urlopen error [Errno -2] Name or service not known>
Will skip URL http://pypi.python.org/simple/git-review when looking for download links for git-review
Getting page http://pypi.python.org/simple/
Could not fetch URL http://pypi.python.org/simple/: <urlopen error [Errno -2] Name or service not known>
Will skip URL http://pypi.python.org/simple/ when looking for download links for git-review
Cannot fetch index base URL http://pypi.python.org/simple/
URLs to search for versions for git-review:
* http://pypi.python.org/simple/git-review/
Getting page http://pypi.python.org/simple/git-review/
Could not fetch URL http://pypi.python.org/simple/git-review/: <urlopen error [Errno -2] Name or service not known>
Will skip URL http://pypi.python.org/simple/git-review/ when looking for download links for git-review
Could not find any downloads that satisfy the requirement git-review
No distributions at all found for git-review
Exception information:
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/pip/basecommand.py", line 126, in main
self.run(options, args)
File "/usr/lib/python2.7/dist-packages/pip/commands/install.py", line 223, in run
requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundle=self.bundle)
File "/usr/lib/python2.7/dist-packages/pip/req.py", line 948, in prepare_files
url = finder.find_requirement(req_to_install, upgrade=self.upgrade)
File "/usr/lib/python2.7/dist-packages/pip/index.py", line 152, in find_requirement
raise DistributionNotFound('No distributions at all found for %s' % req)
DistributionNotFound: No distributions at all found for git-review
I've tried using the --proxy option (--proxy=http://<my_proxy>:<my_port>
with/without the = sign, with/without quotes), but even that shows the same error.
I've also tried setting .pip/pip.conf as follows:
[global]
timeout = 60
proxy = http://<my_proxy>:<my_port>
As another data point, in case it helps, nslookup
from the command line fails for domains outside the corporate intranet, but works for domains inside it. As mentioned, however, Firefox and apt-get seem to have no issues resolving domain names using the proxy.
Any ideas? Thanks!
This was caused by a bug in pip that was solved back in June 2014
https://github.com/pypa/pip/issues/1104
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With