Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/294.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python ';特威顿';对象没有属性。。。运行示例时出错_Python_Twitter_Raspberry Pi_Twython - Fatal编程技术网

Python ';特威顿';对象没有属性。。。运行示例时出错

Python ';特威顿';对象没有属性。。。运行示例时出错,python,twitter,raspberry-pi,twython,Python,Twitter,Raspberry Pi,Twython,我试图在core\u examples文件夹中运行Twython示例,但在所有文件上都出现了相同的错误 如果我运行文件:weekly_trends.py我会得到错误: 'Twython' object has no attribute 'weekly_trends.py'. 'Twython' object has no attribute 'getCurrentTrends'. 如果我运行文件:getCurrentTrends.py我会得到错误: 'Twython' object has

我试图在
core\u examples
文件夹中运行Twython示例,但在所有文件上都出现了相同的错误

如果我运行文件:
weekly_trends.py
我会得到错误:

'Twython' object has no attribute 'weekly_trends.py'.
'Twython' object has no attribute 'getCurrentTrends'.
如果我运行文件:
getCurrentTrends.py
我会得到错误:

'Twython' object has no attribute 'weekly_trends.py'.
'Twython' object has no attribute 'getCurrentTrends'.
我试着在我的Raspberry Pi和OSX上运行代码,但我得到了相同的错误。我假设我缺少安装过程或身份验证的关键部分。我有一个Twitter应用程序设置,我有钥匙和代币。我需要在任何地方输入这些才能让它工作吗?我让Tweepy工作,但Tweython看起来可能有能力在推文中添加图像


任何提示都将不胜感激。

Hmmm,我们的回购协议中不再有
core\u示例
,因此我不确定您运行的是哪个版本的Twython。作为参考,您需要在Twython实例化中使用这些键,ala:

from twython import Twython
t = Twython(app_key, app_secret, oauth_token, oauth_token_secret)
auth_tokens = t.get_authorized_tokens(oauth_verifier)
print auth_tokens
# method calls, etc...
很抱歉这么晚才看到这一切,所以当工作占据我的生活时,我就离开了。希望你在路上