Tweepy error: attribute error

Tweepy error: attribute error

代码工作正常,但突然间开始出现此错误,尽管我没有更改我的代码库。

searched_tweets = ( status._json for status in tweepy.Cursor(api.search, q=query, count=300, since=from_date, until=to_date,
  File "build/bdist.linux-x86_64/egg/tweepy/cursor.py", line 197, in next
  File "build/bdist.linux-x86_64/egg/tweepy/cursor.py", line 108, in next
  File "build/bdist.linux-x86_64/egg/tweepy/binder.py", line 245, in _call
  File "build/bdist.linux-x86_64/egg/tweepy/binder.py", line 189, in execute
tweepy.error.TweepError:
      Failed to send request: 'module' object has no attribute 'HTTPMessage'

我有另一个 python 脚本也使用了 tweepy。但这也开始抛出错误:

stream.filter(track=keyword_list, stall_warnings=True)
  File "build/bdist.linux-x86_64/egg/tweepy/streaming.py", line 445, in filter
  File "build/bdist.linux-x86_64/egg/tweepy/streaming.py", line 361, in _start
  File "build/bdist.linux-x86_64/egg/tweepy/streaming.py", line 294, in _run
AttributeError: 'module' object has no attribute 'HTTPMessage'

我不知道是什么导致了这个错误。我什至尝试重新安装 tweepy 但没有成功。非常感谢任何帮助!

编辑:我发现它来自 tweepy 的 binder.py

我通过安装 Anaconda3.4 解决了这个问题,

pip3 install tweepy

我想这是一个依赖或更新问题。