twint
twint copied to clipboard
ImportError: cannot import name 'CeilTimeout' from 'aiohttp.helpers'
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 usingpip 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
~~Have you tried pip install --force-reinstall aiohttp
? https://github.com/minamotorin/twint/issues/6~~
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 :)
@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.
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.
On what version of Python are you? I can't get it to work on Py 3.6.2...
Python 3.9
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
Thanks this helped me
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. ^^