1
我对Twitter API相当陌生。 我不知道什么是错的这个代码,它应该根据tweepy文档工作确定:迁移到Twitter API版本1.1(?)
import oauth, tweepy
from time import sleep
#stars is confident information
username = "*******"
password = "***********"
auth = tweepy.BasicAuthHandler(username, password)
api = tweepy.API(auth)
api.update_status('hello from tweepy!')
终端显示我:
$ python py/twi.py
Traceback (most recent call last):
File "py/twi.py", line 11, in <module>
api.update_status('hello from tweepy!')
File "/usr/lib/python2.7/dist-packages/tweepy/binder.py", line 179, in _call
return method.execute()
File "/usr/lib/python2.7/dist-packages/tweepy/binder.py", line 162, in execute
raise TweepError(error_msg, resp)
tweepy.error.TweepError: [{'message': 'The Twitter REST API v1 is no longer active. Please migrate to API v1.1. https://dev.twitter.com/docs/api/1.1/overview.', 'code': 68}]
请帮助。
您正在使用不再使用的Twitter API 1.0。 – user568109
你在一段时间内更新了tweepy吗?快速浏览一下github,看起来它已经更新了。 – Collin
我在终端上写了'sudo apt-get install python-tweepy',没有什么新东西。 –