向lis添加成员时出现Tweepy错误

2024-04-25 10:14:08 发布

您现在位置:Python中文网/ 问答频道 /正文

查看以下代码

auth = tweepy.OAuthHandler(consumer_key, consumer_secret)
auth.set_access_token(access_token, access_token_secret)
api = tweepy.API(auth)
api.add_list_member('listslugname', '@twitterhandleto_add')

正在引发以下错误

Traceback (most recent call last):
  File "./twitter_client.py", line 26, in <module>
    api.add_list_member('testl', '@twitterhandleto_add')
  File "/Library/Python/2.7/site-packages/tweepy/binder.py", line 250, in _call
    return method.execute()
  File "/Library/Python/2.7/site-packages/tweepy/binder.py", line 234, in execute
    raise TweepError(error_msg, resp, api_code=api_error_code)
tweepy.error.TweepError: [{u'message': u'You must specify either a list ID or a slug and owner.', u'code': 112}]

仅供参考:pythonv2.7和Tweepy:3.7

请帮忙


Tags: inpytokenauthaddapisecretaccess