我已经安装了tweepy,并且在我的代码中没有“import tweepy”的问题。 当我尝试使用tweepy什么,不过,我面临着以下错误:“导入错误:无法导入名称‘OAuthHandler’”用Python导入Tweepy时出错
from tweepy import OAuthHandler
consumer_token = 'XXX'
consumer_secret = 'YYY'
auth = tweepy.OAuthHandler(consumer_token, consumer_secret)
所有的计算器解决方案,说试试这个,但它仍然不为我
from tweepy.auth import OAuthHandler
consumer_token = 'XXX'
consumer_secret = 'YYY'
auth = tweepy.OAuthHandler(consumer_token, consumer_secret)
有一个名为tweepy.py文件,我不得不为了获得“进口tweepy”安装上班。我应该重命名哪个文件? –
您能否提供我上面的代码的打印输出?找出导致问题的文件会更容易。 –
这是我为你的代码收到的输出(我假设你打算打印(tweepy)): –