Skip to content
This repository has been archived by the owner on Mar 30, 2023. It is now read-only.

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

Open
neonreddeye opened this issue Feb 25, 2022 · 9 comments
Open

Comments

@neonreddeye
Copy link

Initial Check

[QUESTION}

Make sure you've checked the following:

  • [YES, My version is 3.9] Python version is 3.6;
  • [YES] Updated Twint with pip3 install --user --upgrade -e git+https://github.com/twintproject/twint.git@origin/master#egg=twint;
  • [YES] I have searched the issues and there are no duplicates of this issue/question/request.

Command Ran

twint -u username

Description of Issue

What do I do to fix this? I've seen other threads saying rewrite aiohttp with aiohttp==3.7.0 (tried it for 3.8.1) and then install the requirements.txt using
pip3 install . -r requirements.txt
doesn't work then I was taken to another thread which said to upgrade the aiohttp version to 3.8.0 or 3.8.1 using
pip install --upgrade aiohttp
when I executed it,
Requirement already satisfied: aiohttp in /usr/lib/python3/dist-packages (3.8.1)
that's what I got meaning mine was already 3.8.1 apart from those two I didn't find any threads. for a fix.

Environment Details

Using Windows Subsystem for Linux(Kali) Version 2

@minamotorin
Copy link

minamotorin commented Mar 7, 2022

Have you tried pip install --force-reinstall aiohttp? minamotorin#6

@tperka
Copy link

tperka commented Mar 7, 2022

Just remove aiohttp-socks version limitation in requirements.txt because it is enforced to be old version (0.4.1) while aiohttp package is not so it just tries to use functions which has gotten deleted. Newest version of aiohttp-socks package makes this work again :)

minamotorin added a commit to minamotorin/twint that referenced this issue Mar 8, 2022
Fix #6
Solution is from twintproject#1360 (comment)

I'm not sure about twintproject#831, but it seems work fine with also aiohttp_socks 0.4.1 or later.
Version limitation of aiohttp_socks was added by commit twintproject@fef94a5
@minamotorin
Copy link

@tperka
You are right! Thanks so much!

After running pip install --upgrade aiohttp && pip install --force-reinstall aiohttp-socks==0.4.1, I confirmed ImportError: cannot import name 'CeilTimeout' from 'aiohttp.helpers' occurs.

@neonreddeye
Copy link
Author

neonreddeye commented Mar 9, 2022

It works, removing the version from aiohttp-socks in requirements.txt and re-installing the requirements.txt it doesn't install the newest version for some reason. so I tried pip install --upgrade aiohttp && pip install --force-reinstall aiohttp-socks without the ==0.4.1 and it actually works.

@3rfan
Copy link

3rfan commented Mar 21, 2022

On what version of Python are you? I can't get it to work on Py 3.6.2...

@neonreddeye
Copy link
Author

Python 3.9

@atul161
Copy link

atul161 commented Mar 29, 2022

Add this in requirement.txt ! and Thanks me later!

aiodns==3.0.0
aiohttp==3.7.3
aiohttp-socks==0.4.1
aiosignal==1.2.0
async-timeout==3.0.1
attrs==21.4.0
beautifulsoup4==4.10.0
cchardet==2.1.7
certifi==2021.10.8
cffi==1.15.0
chardet==3.0.4
charset-normalizer==2.0.12
dataclasses==0.6
elastic-transport==8.1.0
elasticsearch==8.1.1
fake-useragent==0.1.11
frozenlist==1.3.0
geographiclib==1.52
geopy==2.2.0
googletransx==2.4.2
idna==3.3
multidict==6.0.2
numpy==1.22.3
pandas==1.4.1
pycares==4.1.2
pycparser==2.21
PySocks==1.7.1
python-dateutil==2.8.2
pytz==2022.1
requests==2.27.1
schedule==1.1.0
six==1.16.0
soupsieve==2.3.1
typing-extensions==4.1.1
urllib3==1.26.9
yarl==1.7.2

twint~=2.1.21
setuptools~=57.0.0

@micduffy
Copy link

Thanks this helped me

@Tiya4425
Copy link

Add this in requirement.txt ! and Thanks me later!

aiodns==3.0.0 aiohttp==3.7.3 aiohttp-socks==0.4.1 aiosignal==1.2.0 async-timeout==3.0.1 attrs==21.4.0 beautifulsoup4==4.10.0 cchardet==2.1.7 certifi==2021.10.8 cffi==1.15.0 chardet==3.0.4 charset-normalizer==2.0.12 dataclasses==0.6 elastic-transport==8.1.0 elasticsearch==8.1.1 fake-useragent==0.1.11 frozenlist==1.3.0 geographiclib==1.52 geopy==2.2.0 googletransx==2.4.2 idna==3.3 multidict==6.0.2 numpy==1.22.3 pandas==1.4.1 pycares==4.1.2 pycparser==2.21 PySocks==1.7.1 python-dateutil==2.8.2 pytz==2022.1 requests==2.27.1 schedule==1.1.0 six==1.16.0 soupsieve==2.3.1 typing-extensions==4.1.1 urllib3==1.26.9 yarl==1.7.2

twint~=2.1.21 setuptools~=57.0.0

Thank you so much ,it worked for me like a miracle. ^^

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

7 participants