我已经安装了 Python 2.7 并尝试使用 Twitter 包。我已成功安装了 3 个必备软件包...我已获得使用者密钥和访问令牌...但不知何故收到此错误:
>>> import twitter
>>> api = twitter.Api(consumer_key='consumer_key',
consumer_secret='consumer_secret',
access_token_key='access_token',
access_token_secret='access_token_secret')
>>> print api.VerifyCredentials()
Traceback (most recent call last):
File "<pyshell#7>", line 1, in <module>
print api.VerifyCredentials()
File "build\bdist.win32\egg\twitter.py", line 4257, in VerifyCredentials
json = self._FetchUrl(url, no_cache=True)
File "build\bdist.win32\egg\twitter.py", line 4611, in _FetchUrl
response = opener.open(url, encoded_post_data)
File "C:\Python\Python27\lib\urllib2.py", line 404, in open
response = self._open(req, data)
File "C:\Python\Python27\lib\urllib2.py", line 422, in _open
'_open', req)
File "C:\Python\Python27\lib\urllib2.py", line 382, in _call_chain
result = func(*args)
File "C:\Python\Python27\lib\urllib2.py", line 1222, in https_open
return self.do_open(httplib.HTTPSConnection, req)
File "C:\Python\Python27\lib\urllib2.py", line 1184, in do_open
raise URLError(err)
URLError: <urlopen error [Errno 10060] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond>
所有其他命令也导致相同的错误......例如
statuses = api.GetUserTimeline(user)
任何帮助,将不胜感激...