在tweepy 3.5中使用streaming.py解析twitter数据时间歇性地发生此错误 .
我在过去的帖子中看到了关于这个的讨论,但还没有看到解决方案 .
一个人建议安装tweepy 3.2,但我们现在在3.5,所以这似乎不合理 .

跟踪和我的软件版本如下:

回溯(最近一次调用最后一次):文件“newt5.py”,第223行,在sapi.filter中(track = ['BTC','Bitcoin'],languages = ['en'])File“/ Library / Frameworks /Python.framework/Versions/3.6/lib/python3.6/site-packages/tweepy/streaming.py“,第445行,在过滤器self._start(async)文件中”/Library/Frameworks/Python.framework/Versions/ 3.6 / lib / python3.6 / site-packages / tweepy / streaming.py“,第361行,在_start self._run()文件中”/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/ site-packages / tweepy / streaming.py“,第294行,在_run中引发异常文件”/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/tweepy/streaming.py“,第263行,在_run self._read_loop(resp)文件“/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/tweepy/streaming.py”,第313行,在_read_loop line = buf.read_line() . strip()AttributeError:'NoneType'对象没有属性'strip'

pip3显示了tweepy

Name: tweepy
Version: 3.5.0
Summary: Twitter library for python
Home-page: http://github.com/tweepy/tweepy
Author: Joshua Roesslein
Author-email: tweepy@googlegroups.com
License: MIT
Location: /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages