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' #1297

Open
Moham-AT opened this issue Nov 2, 2021 · 27 comments · May be fixed by #1299 or #1323
Open

[IMPORTERROR] cannot import name 'CeilTimeout' from 'aiohttp.helpers' #1297

Moham-AT opened this issue Nov 2, 2021 · 27 comments · May be fixed by #1299 or #1323

Comments

@Moham-AT
Copy link

Moham-AT commented Nov 2, 2021

Command Ran

import twint
import nest_asyncio
nest_asyncio.apply()
c = twint.Config()
c.Username = "github"

Description of Issue

its about one month that i am using this repo and it was ok fetching tweets. but today it can't import twint (specifically the aiohttp.helpers and CeilTimeout ) and so i can't fetch any tweet. how can i fix this?

Environment Details

i'm using twint on google colab and this is the way i use the repo on colab:

!git clone --depth=1 https://github.com/twintproject/twint.git
%cd twint
!git pull origin master
!pip install -r requirements.txt
!python setup.py install

@Moham-AT Moham-AT changed the title [ERROR] cannot import name 'CeilTimeout' from 'aiohttp.helpers' [IMPORTERROR] cannot import name 'CeilTimeout' from 'aiohttp.helpers' Nov 2, 2021
@akmalsabri
Copy link

yeah I got this issue also

@usijusolomon
Copy link

Me too

@devilliers13
Copy link

Same issue here, fresh install on Ubuntu 20.04 shows the same error.

ImportError: cannot import name 'CeilTimeout' from 'aiohttp.helpers' (/usr/local/lib/python3.8/dist-packages/aiohttp/helpers.py

@mahdi-1992
Copy link

yeah I got this issue also

@koboskom
Copy link

koboskom commented Nov 2, 2021

got same issue, in file /usr/local/lib/python3.7/dist-packages/aiohttp_socks/connector.py comment line 8 "from aiohttp.helpers import CeilTimeout # noqa", it works fine afterwards

@josx
Copy link

josx commented Nov 2, 2021

To fix it you must to have fixed version on aiohttp.
Edit requeriments.txt with aiohttp==3.7.0

@josx josx linked a pull request Nov 2, 2021 that will close this issue
@devilliers13
Copy link

Thanks! that has fixed it.

@Moham-AT
Copy link
Author

Moham-AT commented Nov 3, 2021

To fix it you must to have fixed version on aiohttp. Edit requeriments.txt with aiohttp==3.7.0

it works, thanks!

@cihanicelliler
Copy link

cihanicelliler commented Nov 8, 2021

To fix it you must to have fixed version on aiohttp. Edit requeriments.txt with aiohttp==3.7.0

It stil didn't change anything. First of all I uninstalled my aiohttp then I installed with aiohttp==3.7.0 but error didn't change.

@wjd157
Copy link

wjd157 commented Nov 18, 2021

Changing aiohttp to aiohttp==3.7.0 in the .txt file did not fix the issue for me either.

@danielleschn
Copy link

Didn't work for me either, unfortunately.

@josx
Copy link

josx commented Nov 18, 2021

@danielleschn @wjd157 @cihanicelliler make sure you did pip3 install . -r requirements.txt after changing requirements file from a dependency free environment. It seems that pip will not downgrade your version if it finds a newer version present.

Or maybe you can do pip install aiohttp==3.7.0 directly to test it out.

@abhirup780
Copy link

pip install aiohttp==3.7.0 directly didn't work. But doing a pip3 install . -r requirements.txt after changing aiohttp to aiohttp==3.7.0 works

@soukainaElGhaldy
Copy link

Fixed this problem by installing directly aiohttp module on my environment using : conda install aiohttp ! you can usepip install aiohttp

@cracker8090
Copy link

conda install aiohttp

The version of aiohttp is 3.7.0? my aiohttp is 3.8.1 and errors still exist.

@danielleschn
Copy link

Didn't work for me either, unfortunately.

Okay the issue was that I needed to make sure I was installing it in the correct place and then rebuild the docker container, haha.

@soukainaElGhaldy
Copy link

So Conda environments (also python env) seems to have issues with twint config. So Tried on CLI. what worked for me is what @josx suggested so first I changed aiohttp to aiohttp==3.7.0 in my requirements.txt then pip3 install . -r requirements.txt and then scrap with for example my twint -s bitcoin -- since "2021-11-23 11:00:58" worked fine.
Thank you again @josx !

@taohuadaohongye
Copy link

uninstall the aiohttp 3.8 and install aiohttp3.7
command :pip show aiohttp
you will see the aiohttp version is 3.8
command:pip uninstall aiohttp
done,command pip install aiohttp==3.7.0
it will work !

@Abdelrahmanrezk
Copy link

To fix it you must to have fixed version on aiohttp. Edit requeriments.txt with aiohttp==3.7.0

Thanks for your help, it solve the problem with me.

@Icebrey
Copy link

Icebrey commented Dec 11, 2021

uninstall the aiohttp 3.8 and install aiohttp3.7 command :pip show aiohttp you will see the aiohttp version is 3.8 command:pip uninstall aiohttp done,command pip install aiohttp==3.7.0 it will work !

thanks mate, it works

Protinon added a commit to Protinon/twint that referenced this issue Dec 12, 2021
adamlesniak pushed a commit to adamlesniak/twint that referenced this issue Jan 2, 2022
adamlesniak pushed a commit to adamlesniak/twint that referenced this issue Jan 2, 2022
@adamlesniak adamlesniak linked a pull request Jan 2, 2022 that will close this issue
@adamlesniak
Copy link

Hey,

Just tried to run this project and wasn't able to - provided a fix in #1323 - could be good to have it in master for anyone that just tries to use it out of the box.

Thanks,
Adam

@rehman4u
Copy link

To fix it you must to have fixed version on aiohttp. Edit requeriments.txt with aiohttp==3.7.0

How to edit requirements.txt in aiohttps? Any youtube video on it?

@adamlesniak
Copy link

To fix it you must to have fixed version on aiohttp. Edit requeriments.txt with aiohttp==3.7.0

How to edit requirements.txt in aiohttps? Any youtube video on it?

It's just a file - you can find detailed instructions here:

https://www.jetbrains.com/help/pycharm/managing-dependencies.html#create-requirements

Or you can clone my fork and it covers this update: https://github.com/adamlesniak/twint

This was referenced Jan 26, 2022
tweedge added a commit to DeepCISO/twint that referenced this issue Feb 8, 2022
pragyakarki added a commit to pragyakarki/twint that referenced this issue Feb 11, 2022
Trying to resolve the issue mention here: twintproject#1297

Followed the instruction to downgrade or set aiohttp version to 3.7.0 from aiohttp==3.8.1.
@pragyakarki
Copy link

Thank you @josx . Came across this issue while trying to run twint in Github Actions with latest ubuntu version.

@RajaKathireshh
Copy link

RajaKathireshh commented Mar 16, 2022

First install this in a separate cell pip install aiohttp==3.7.0
then install !pip3 install --user --upgrade -e git+https://github.com/twintproject/twint.git@origin/master#egg=twint
now import twint
It's working fine for me and I'm able to crawl data.

If still not working, restart the runtime and follow the same order. Sometimes restarting the runtime after installation works.

@KlausGlueckert
Copy link

same error, chaning to aiohttp==3.7.0 solved it

@gmusebe
Copy link

gmusebe commented Apr 19, 2022

@danielleschn @wjd157 @cihanicelliler make sure you did pip3 install . -r requirements.txt after changing requirements file from a dependency free environment. It seems that pip will not downgrade your version if it finds a newer version present.

Or maybe you can do pip install aiohttp==3.7.0 directly to test it out.

The last bit fixed it for me

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