Aiohttp: TypeError: 'ABCMeta' aiohttp==3.6.0, Python 3.6.9

Created on 10 Sep 2019  路  5Comments  路  Source: aio-libs/aiohttp

Long story short

Cant import aiohttp

pip freeze gives: aiohttp==3.6.0
python3 version: Python 3.6.9

import aiohttp
Traceback (most recent call last):
File "", line 1, in
File "/usr/local/lib/python3.6/site-packages/aiohttp/__init__.py", line 6, in
from .client import BaseConnector as BaseConnector
File "/usr/local/lib/python3.6/site-packages/aiohttp/client.py", line 63, in
from .client_reqrep import ClientRequest as ClientRequest
File "/usr/local/lib/python3.6/site-packages/aiohttp/client_reqrep.py", line 29, in
from . import hdrs, helpers, http, multipart, payload
File "/usr/local/lib/python3.6/site-packages/aiohttp/multipart.py", line 703, in
class MultipartWriter(Payload):
File "/usr/local/lib/python3.6/site-packages/aiohttp/multipart.py", line 786, in MultipartWriter
headers: Optional[MultiMapping[str]]=None
TypeError: 'ABCMeta' object is not subscriptable

Any known restriction, what I am missing?

pr-merged

Most helpful comment

Try pip install -U multidict.
multidict>=4.5 is required.

All 5 comments

How did you solved it?

I got the same issue. Any idea about how to solve it?
python 3.7
aiohttp 3.6.0

Anyone has a reproducer? Also, what is the method for aiohttp installation that you use?

For my case, aiohttp was installed as a dependency of another python module named spade. I used pip to install it. The list of all pip packages are as follows:

aiohttp 3.6.0
aiohttp-jinja2 1.1.2
aioopenssl 0.4.1
aiosasl 0.4.0
aioxmpp 0.10.5
arrow 0.15.1
asn1crypto 0.24.0
async-timeout 3.0.1
attrs 19.1.0
Babel 2.7.0
certifi 2019.6.16
cffi 1.12.3
chardet 3.0.4
cryptography 2.7
dnspython 1.16.0
idna 2.8
Jinja2 2.10.1
jinja2-time 0.2.0
lxml 4.4.1
MarkupSafe 1.1.1
multidict 4.4.0
pip 19.2.2
pyasn1 0.4.7
pyasn1-modules 0.2.6
pycparser 2.19
pyOpenSSL 19.0.0
python-dateutil 2.8.0
pytz 2019.2
setuptools 41.0.1
singletonify 0.2.3
six 1.12.0
sortedcollections 1.1.2
sortedcontainers 2.1.0
spade 3.1.3
timeago 1.0.8
tzlocal 1.5.1
wheel 0.33.4
yarl 1.3.0

Try pip install -U multidict.
multidict>=4.5 is required.

Was this page helpful?
0 / 5 - 0 ratings