代码工作正常,但突然间这个错误开始提升,但我没有改变我的代码库。
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但没有运气。任何帮助都非常感谢!
答案 0 :(得分:0)
我能够通过安装Anaconda3.4然后
来解决这个问题pip3安装tweepy
我认为这是一个依赖或更新问题。