I am installing a python package that depends on aiohttp, version >=3. pip3 search aiohttp returns:
aiohttp (3.3.2) - Async http client/server framework (asyncio)
INSTALLED: 2.3.10
LATEST: 3.3.2
So why does pip3 install --upgrade --user aiohttp respond that it's already up to date, and pip3 install --user aiohttp==3.3.2 say:
Could not find a version that satisfies the requirement aiohttp==3.3.2 [... snip ...] No matching distribution found for aiohttp==3.3.2
I am running Ubuntu 16.04, Python v.3.5.2, and pip3 v.18.0. The latter is an upgrade to the system's v.8.1.1 from the apt package python3-pip. Pip3 was upgraded locally using pip3 upgrade --user so as not to conflict with the system packages.
Version 3 of aiohttp requires Python to be at least version 3.5.3; the documentation explains:
Why not 3.5.0? Because 3.5.3 has a crucial change:
asyncio.get_event_loop()returns the running loop instead of default, which may be different, e.g.:loop = asyncio.new_event_loop() loop.run_until_complete(f())Note,
asyncio.set_event_loop()was not called and default loop is not equal to actually executed one.
As a result, pip running on Python 3.5.2 or any earlier version will ignore aiohttp v3 when installing; the fact that the newer version still shows up under pip search is arguably a bug.
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