kitten
kitten

Reputation: 41

ImportError: cannot import name 'CeilTimeout' from 'aiohttp.helpers'

I am getting an error while importing twint. I have tried a virtual environment too.

ImportError Traceback (most recent call last) C:\Users\name\AppData\Local\Temp/ipykernel_12356/3064374937.py in ----> 1 import twint

D:\NLP\twint\twint_init_.py in 12 from .config import Config 13 from .version import version ---> 14 from . import run 15 16 _levels = {

D:\NLP\twint\twint\run.py in 2 from asyncio import get_event_loop, TimeoutError, ensure_future, new_event_loop, set_event_loop 3 ----> 4 from . import datelock, feed, get, output, verbose, storage 5 from .token import TokenExpiryException 6 from . import token

D:\NLP\twint\twint\get.py in 10 import random 11 from json import loads, dumps ---> 12 from aiohttp_socks import ProxyConnector, ProxyType 13 from urllib.parse import quote 14

c:\users\name\appdata\local\programs\python\python38\lib\site-packages\aiohttp_socks_init_.py in 3 4 from .proxy import SocksVer, ProxyType ----> 5 from .connector import ( 6 SocksConnector, ProxyConnector, 7 ChainProxyConnector, ProxyInfo

c:\users\name\appdata\local\programs\python\python38\lib\site-packages\aiohttp_socks\connector.py in 6 from aiohttp import TCPConnector 7 from aiohttp.abc import AbstractResolver ----> 8 from aiohttp.helpers import CeilTimeout # noqa 9 10 from .proxy import (ProxyType, SocksVer, ChainProxy,

ImportError: cannot import name 'CeilTimeout' from 'aiohttp.helpers' (c:\users\name\appdata\local\programs\python\python38\lib\site-packages\aiohttp\helpers.py)

Upvotes: 4

Views: 7413

Answers (4)

Nurlan Mamedli
Nurlan Mamedli

Reputation: 1

I replaced

aiohttp==3.7.0 

then intalled aiohttp with

pip install aiohttp==3.7.0

and it worked

Upvotes: 0

Shender Ramos
Shender Ramos

Reputation: 53

you can just ra!pip install aiohttp==3.7.0 or go with @p4W3k answer as well, you have an outdate version or not a stable one

Upvotes: 1

p4W3k
p4W3k

Reputation: 51

Edit requeriments.txt. 1st Line, instead aiohttp replace with aiohttp==3.7.0

See this: https://github.com/twintproject/twint/issues/1297 Maybe can help you.

Upvotes: 5

StarGit
StarGit

Reputation: 35

I had the same error I switched building my notebook from localhost to kaggle, fell free to use Google Collab. Best of luck,

Upvotes: 1

Related Questions