简体   繁体   中英

ImportError: cannot import name 'TwitterRestPager' from 'TwitterAPI' (C:\Users\My name \Anaconda3\lib\site-packages\TwitterAPI\__init__.py)

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.

Related Question ImportError: cannot import name 'set_random_seed' from 'tensorflow' (C:\Users\polon\Anaconda3\lib\site-packages\tensorflow\__init__.py) ImportError: cannot import name 'logsumexp' from 'scipy.misc' (C:\Users\firstname.lastname\Anaconda3\lib\site-packages\scipy\misc\__init__.py) ImportError: cannot import name '_message' from 'google.protobuf.pyext' (c:\programdata\anaconda3\lib\site-packages\google\protobuf\pyext\__init__.py) cannot import name 'BisectingKMeans' from 'sklearn.cluster' (C:\Users\Administrator\anaconda3\lib\site-packages\sklearn\cluster\__init__.py) import MySQLdb报错ImportError: cannot import name '_mysql' from 'MySQLdb' (D:\python\lib\site-packages\MySQLdb\__init__.py) importerror: cannot import name 'dump' from 'dump' (~/.local/lib/python3.8/site-packages/dump/__init__.py) Error: from matplotlib import _png ImportError: cannot import name '_png' from 'matplotlib' (C:\\Garden\lib\site-packages\matplotlib\__init__.py) ImportError: cannot import name 'doc' from 'pandas.util._decorators' (C:\ProgramData\Anaconda3\lib\site-packages\pandas\util\_decorators.py) Django2.1.7 ImportError: cannot import name 'util' from 'django.forms' (/Users/lib/python3.7/site-packages/django/forms/__init__.py) ImportError: cannot import name 'Nullable' from 'bokeh.core.properties' (C:\ProgramData\Anaconda3\lib\site-packages\bokeh\core\properties.py)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM