Skip to main content
 首页 » 编程设计

python之身份验证失败,代码为 32

2025年05月04日10飞鱼

嗨,有人可以帮我吗?

import tweepy 
 
CONSUMER_KEY = '' 
CONSUMER_SECRET = '' 
ACCESS_TOKEN = '-' 
ACCESS_TOKEN_SECRET = '' 
 
auth = tweepy.OAuthHandler(CONSUMER_KEY, CONSUMER_SECRET) 
auth.set_access_token(ACCESS_TOKEN, ACCESS_TOKEN_SECRET) 
api = tweepy.API(auth) 
 
status = "Testing!" 
api.update_status(status=status) 

它给了我那个错误

'code': 32, 'message': 'Could not authenticate you.'

请您参考如下方法:

您的代码没有问题,这是一个身份验证问题。请引用https://dev.twitter.com/overview/api/response-codes

Code: 32

Text: Could not authenticate you

Description: Your call could not be completed as dialed.

在 Twitter 的开发者论坛上有一个关于这个 here 的话题.您可能应该通过 Twitter 检查一下。