【发布时间】:2013-10-05 11:56:43
【问题描述】:
我正在尝试使用 python 包管理器 pip 来安装一个包,它是来自 Internet 的依赖项。但是我在我的大学里有一个代理,并且已经设置了http_proxy 环境变量。但是当我尝试安装这样的包时:
pip install TwitterApi
我在日志文件中收到此错误:
Getting page http://pypi.python.org/simple/TwitterApi
Could not fetch URL http://pypi.python.org/simple/TwitterApi: <urlopen error [Errno 111] Connection refused>
Will skip URL http://pypi.python.org/simple/TwitterApi when looking for download links for TwitterApi
Getting page http://pypi.python.org/simple/
Could not fetch URL http://pypi.python.org/simple/: <urlopen error [Errno 111] Connection refused>
我什至尝试像这样显式设置代理变量:
pip install --proxy http://user:password@proxyserver:port TwitterApi
但我仍然遇到同样的错误。如何让 pip 在代理服务器后面工作。
【问题讨论】:
-
你能在浏览器中浏览到 pypi.python.org 吗?
-
是的。我可以毫无问题地浏览互联网。我还在 wgetrc 文件中为 wget 配置了代理,
wget似乎正在工作。甚至git也在使用一些代理配置。但是pip不断抛出同样的错误。 -
查看类似问题的答案。 stackoverflow.com/questions/11726881/…