from twitter.api import Api
Api = twitter.api(consumer_key='[gdgfdfhgfuff] ',
consumer_secret='[jhhjf] ',
access_token_key=' [jhvhvvhjvhvhvh]',
access_token_secret='[hvghgvvh] ')
friends=Api.PostUpdate("First Tweet from PYTHON APP ")
错误
TTraceback (most recent call last):
File "<pyshell#5>", line 1, in <module>
from twitter.api import Api
ImportError: cannot import name 'Api'
我正在使用python 3.4和twitter-1.14.2 api
答案 0 :(得分:0)
答案 1 :(得分:0)
您使用的Twitter包没有Api
类。
源代码链接:https://github.com/sixohsix/twitter/blob/master/twitter/api.py
您必须将其用作
from twitter.api import Twitter
twitter = Twitter(auth=OAuth(
token, token_secret, consumer_key, consumer_secret))