【发布时间】:2022-11-11 03:02:14
【问题描述】:
我在处理 tweepy 的新旧文档时遇到了问题,似乎所有在以前的版本中都可以正常工作,但是有很多变化,我现在很难让它工作。任何想法为什么我有这个错误?
import tweepy
client = tweepy.Client(bearer_token='[redacted]',
consumer_key='[redacted]',
consumer_secret='[redacted]',
access_token='[redacted]',
access_token_secret='[redacted]')
api = tweepy.API(client)
public_tweets = api.home_timeline()
for tweet in public_tweets:
print(tweet.text)
我收到这个错误
AttributeError: 'Client' object has no attribute 'apply_auth'
【问题讨论】:
-
注意:编辑您的问题以删除您的 API 凭据不会使它们不可用。您的问题的旧版本仍然可用,并且仍然包含该信息。