`pip3 search aiohttp`显示更新的版本,但不会安装

时间:2018-08-28 00:54:48

标签: python-3.x pip

我正在安装一个依赖于aiohttp版本== 3的python软件包。 pip3 search aiohttp返回:

aiohttp (3.3.2)  - Async http client/server framework (asyncio)
  INSTALLED: 2.3.10
  LATEST:    3.3.2

所以pip3 install --upgrade --user aiohttp为什么回答它已经是最新的,而pip3 install --user aiohttp==3.3.2说:

Could not find a version that satisfies the requirement aiohttp==3.3.2 [... snip ...] No matching distribution found for aiohttp==3.3.2

我正在运行Ubuntu 16.04,Python v.3.5.2和pip3 v.18.0。后者是apt软件包python3-pip对系统v.8.1.1的升级。 Pip3已使用pip3 upgrade --user在本地升级,以免与系统软件包冲突。

1 个答案:

答案 0 :(得分:4)

aiohttp的版本3要求Python至少为3.5.3版本; the documentation explains:

  

为什么不是 3.5.0 ?因为 3.5.3 有一个重要的更改:asyncio.get_event_loop()返回运行循环而不是 default ,这可能会有所不同,例如:

loop = asyncio.new_event_loop()
loop.run_until_complete(f())
     

请注意,asyncio.set_event_loop()没有被调用,并且默认循环不等于实际执行的循环。

因此,在Python 3.5.2或更早版本上运行的pip在安装时将忽略aiohttp v3;较新版本仍显示在pip search下的事实可以说是一个错误。