I'm trying to import TwitterRestPager
, but keep getting the error:
"cannot import name 'TwitterRestPager' from 'TwitterAPI' (C:\Users\My
name\Anaconda3\lib\site-packages\TwitterAPI\__init__.py) "
-- (the My Name in the file path is my actual name just replaced for privacy purposes)
I already updated both requests and TwitterApi
.
Here is the code I'm trying to run:
! pip install TwitterAPI
! pip install TwitterAPI --upgrade
from TwitterAPI import TwitterRestPager
You can use TwitterPager instead. It looks like TwitterRestPager is depreciated in the newer version (available in TwitterAPI 2.4.1https://pydoc.net/TwitterAPI/2.4.1/TwitterAPI.TwitterRestPager/ )
Check the site packages if the TwitterRestPager is in it. If it is not, and pip is not properly installing it, try to find the script or file online, and download it to the directory from which it is being imported from.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.