如下图,其实没什么可补充的...
你好
我运行这段代码
import tweepy
client = tweepy.Client(
consumer_key="XXXX",
consumer_secret="XXXX",
access_token="XXXX",
access_token_secret="XXXX"
)
following = client.get_users_following(1550947094185349127)
print(following)
并得到以下回复
Traceback (most recent call last):
File "C:\bot\Tests.py", line 11, in <module>
following = client.get_users_following(1550947094185349127)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\totes\AppData\Local\Programs\Python\Python311\Lib\site-packages\tweepy\client.py", line 2147, in get_users_following
return self._make_request(
^^^^^^^^^^^^^^^^^^^
File "C:\Users\totes\AppData\Local\Programs\Python\Python311\Lib\site-packages\tweepy\client.py", line 129, in _make_request
response = self.request(method, route, params=request_params,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\totes\AppData\Local\Programs\Python\Python311\Lib\site-packages\tweepy\client.py", line 98, in request
raise Unauthorized(response)
tweepy.errors.Unauthorized: 401 Unauthorized
Unauthorized
我应该提到我的 API 密钥是正确的,因为我将它们用于另一个没有问题的代码