从MacOs命令行运行Tweepy代码时出现错误93

从我的命令行运行代码,得到此错误:

  

tweepy.error.TweepError:[{'code':93,'message':'此应用程序是   不允许访问或删除您的直接消息。'}]

...即使API密钥的权限设置为“读取,写入和直接消息”。

import tweepy

# Consumer keys and access tokens,used for OAuth
consumer_key = ''
consumer_secret = ''
access_token = ''
access_token_secret = ''


# Authenticate to Twitter
auth = tweepy.OAuthHandler(consumer_key,consumer_secret)
auth.set_access_token(access_token,access_token_secret)

api = tweepy.API(auth,wait_on_rate_limit=True,wait_on_rate_limit_notify=True)

try:
    api.verify_credentials()
    print("Authentication OK")
except:
    print("Error during authentication")

messages = api.list_direct_messages()
print (messages)
haihaome1 回答:从MacOs命令行运行Tweepy代码时出现错误93

暂时没有好的解决方案,如果你有好的解决方案,请发邮件至:iooj@foxmail.com
本文链接:https://www.f2er.com/3117854.html

大家都在问