终端中Twitter Python API - 安装错误
我安装了以下库,并完成了推特Python设置的所有步骤:
httplib2-0.7.1 simplegeo-python-oauth2-1fcc1a6 python-twitter-0.8.2 simplejson-2.1.6
我使用的设置说明在这里:http://code.google.com/p/python-twitter/
当我运行 python setup.py test 时,出现了17个错误。以下是输出的一部分(抱歉内容有点多):
testNewFromJsonDict (twitter_test.UserTest)
Test the twitter.User NewFromJsonDict method ... ok
testProperties (twitter_test.UserTest)
Test all of the twitter.User properties ... ok
testCreateFriendship (twitter_test.ApiTest)
Test the twitter.Api CreateFriendship method ... ERROR
testDestroyDirectMessage (twitter_test.ApiTest)
Test the twitter.Api DestroyDirectMessage method ... ERROR
testDestroyFriendship (twitter_test.ApiTest)
Test the twitter.Api DestroyFriendship method ... ERROR
testDestroyStatus (twitter_test.ApiTest)
Test the twitter.Api DestroyStatus method ... ERROR
testGetDirectMessages (twitter_test.ApiTest)
Test the twitter.Api GetDirectMessages method ... ERROR
testGetFeatured (twitter_test.ApiTest)
Test the twitter.Api GetFeatured method ... ERROR
testGetFollowers (twitter_test.ApiTest)
Test the twitter.Api GetFollowers method ... ERROR
testGetFriends (twitter_test.ApiTest)
Test the twitter.Api GetFriends method ... ERROR
testGetFriendsTimeline (twitter_test.ApiTest)
Test the twitter.Api GetFriendsTimeline method ... ERROR
testGetPublicTimeline (twitter_test.ApiTest)
Test the twitter.Api GetPublicTimeline method ... ERROR
testGetReplies (twitter_test.ApiTest)
Test the twitter.Api GetReplies method ... ERROR
testGetStatus (twitter_test.ApiTest)
Test the twitter.Api GetStatus method ... ERROR
testGetUser (twitter_test.ApiTest)
Test the twitter.Api GetUser method ... ERROR
testGetUserTimeline (twitter_test.ApiTest)
Test the twitter.Api GetUserTimeline method ... ERROR
testPostDirectMessage (twitter_test.ApiTest)
Test the twitter.Api PostDirectMessage method ... ERROR
testPostUpdate (twitter_test.ApiTest)
Test the twitter.Api PostUpdate method ... ERROR
testTwitterError (twitter_test.ApiTest)
Test that twitter responses containing an error message are wrapped. ... ERROR
1 个回答
0
我觉得你省略的错误信息里有很重要的内容,可以帮助你解决问题。让我猜一下——你从项目的下载区下载了tar.gz文件,但不知道为什么里面没有包含测试数据。所以失败的原因可能是找不到需要的测试数据。你可以在它的代码库里查看:http://code.google.com/p/python-twitter/source/browse/#hg%2Ftestdata
如果真是这样,别慌张。继续进行你和Twitter API的实际互动就好了。