【问题标题】:pip install treq failingpip install tr​​eq 失败
【发布时间】:2013-11-12 20:10:34
【问题描述】:

根据http://treq.readthedocs.org/en/latest/,可以使用pip 安装treq,但是它失败了。我可以使用 tar 文件安装 treq,但我想知道为什么这会失败,因为 http://pypi.python.org/simple/treq/ 有 0.1.0 和 0.2.0。

$ sudo pip install treq
Downloading/unpacking treq
  Cannot fetch index base URL http://pypi.python.org/simple/
  Could not find any downloads that satisfy the requirement treq
No distributions at all found for treq
Storing complete log in <cut>.pip/pip.log
$ pip search treq
megrok.strictrequire      - Checks that all grokked "view-like" components
                            require a permission.
streql                    - Constant-time string comparison
trequests                 - A Tornado async HTTP/HTTPS client adaptor for
                            python-requests
treq                      - A requests-like API built on top of twisted.web's
                            Agent
repoze.bfg.restrequest    - a REST aware Request for implementing RESTful
                            applications with repoze.bfg

$

刚尝试从 tarfile 安装,也找不到扭曲的,所以想知道 pip 是否存在基本问题...

$ sudo python setup.py install
running install
Checking .pth file support in /usr/local/lib/python2.7/dist-packages/
<snip>
Extracting treq-0.2.0-py2.7.egg to /usr/local/lib/python2.7/dist-packages
Adding treq 0.2.0 to easy-install.pth file

Installed /usr/local/lib/python2.7/dist-packages/treq-0.2.0-py2.7.egg
Processing dependencies for treq==0.2.0
Searching for Twisted>=12.1.0
Reading http://pypi.python.org/simple/Twisted/
Download error on http://pypi.python.org/simple/Twisted/: timed out -- Some packages      may not be found!
Reading http://pypi.python.org/simple/Twisted/
Download error on http://pypi.python.org/simple/Twisted/: timed out -- Some packages     may not be found!
Couldn't find index page for 'Twisted' (maybe misspelled?)
Scanning index of all packages (this may take a while)
Reading http://pypi.python.org/simple/
Download error on http://pypi.python.org/simple/: timed out -- Some packages may not be found!
No local packages or download links found for Twisted>=12.1.0
error: Could not find suitable distribution for Requirement.parse('Twisted>=12.1.0')
$

【问题讨论】:

  • 为了它的价值:永远不要这样做sudo pip install。要么使用可以让您将东西安装到系统外部位置的东西,例如 virtualenvpip install --user,要么使用旨在与您的系统集成的东西,例如 pypi-install
  • 感谢您的反馈。我试过 pypi-install tr​​eq 也没有用。
  • 对我来说很好用。您确定没有防火墙/防病毒软件阻止它吗?
  • 谢谢,是的,这似乎是问题所在。
  • 这个问题似乎离题了,因为它太本地化了

标签: python http twisted pip


【解决方案1】:

错误信息如下:

Download error on http://pypi.python.org/simple/Twisted/: timed out -- Some packages may not be found!

您是否检查了阻止访问 PyPI 的防火墙?

【讨论】:

  • 好点,我什至没有想到这一点,因为我可以从我的电脑浏览器访问pypi.python.org/simple/Twisted。但是从我尝试安装的节点执行 wget 失败,所以它似乎与防火墙相关。
  • 是的,这是防火墙问题。设置 https_proxy 等解决了这个问题。
猜你喜欢
  • 2021-01-26
  • 2015-12-22
  • 2012-09-24
  • 2018-10-11
  • 2015-05-05
  • 2021-03-16
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多