我对 ipython 和 twython 的概念很陌生。但是我想使用 twitter.search 查询检索一些数据。但是当我使用它时,它给了我以下错误
In [3]: search_results = twitter.search(q="#india", rpp="50")
---------------------------------------------------------------------------
TwythonError Traceback (most recent call last)
/home/vishal/<ipython-input-3-241f789b11cc> in <module>()
----> 1 search_results = twitter.search(q="#india", rpp="50")
/usr/local/lib/python2.7/dist-packages/twython-2.5.5-py2.7.egg/twython/twython.pyc in search(self, **kwargs)
365 """
366
--> 367 return self.get('https://api.twitter.com/1.1/search/tweets.json', params=kwargs)
368
369 def searchGen(self, search_query, **kwargs):
/usr/local/lib/python2.7/dist-packages/twython-2.5.5-py2.7.egg/twython/twython.pyc in get(self, endpoint, params, version)
236
237 def get(self, endpoint, params=None, version='1.1'):
--> 238 return self.request(endpoint, params=params, version=version)
239
240 def post(self, endpoint, params=None, files=None, version='1.1'):
/usr/local/lib/python2.7/dist-packages/twython-2.5.5-py2.7.egg/twython/twython.pyc in request(self, endpoint, method, params, files, version)
231 url = '%s/%s.json' % (self.api_url % version, endpoint)
232
--> 233 content = self._request(url, method=method, params=params, files=files, api_call=url)
234
235 return content
/usr/local/lib/python2.7/dist-packages/twython-2.5.5-py2.7.egg/twython/twython.pyc in _request(self, url, method, params, files, api_call)
208 raise exceptionType(error_msg,
209 error_code=response.status_code,
--> 210 retry_after=response.headers.get('retry-after'))
211
212 # if we have a json error here, then it's not an official TwitterAPI error
TwythonError: 'Bad Request: The request was invalid. An accompanying error message will explain why. This is the status code will be returned during rate limiting. -- An error occurred processing your request
可能是什么问题。是否需要身份验证
谢谢