【发布时间】:2016-09-08 19:29:33
【问题描述】:
我使用的是 Python 3.5.1,这是错误:
Traceback (most recent call last):
File "C:\Users\KORKUSUZ\Desktop\twitter-realtime-heatmap-master\tstream.py", line 55, in <module>
streamer.filter(track = setTerms)
File "C:\Users\KORKUSUZ\AppData\Local\Programs\Python\Python35\lib\site-packages\tweepy-3.6.0-py3.5.egg\tweepy\streaming.py", line 447, in filter
self._start(async)
File "C:\Users\KORKUSUZ\AppData\Local\Programs\Python\Python35\lib\site-packages\tweepy-3.6.0-py3.5.egg\tweepy\streaming.py", line 361, in _start
self._run()
File "C:\Users\KORKUSUZ\AppData\Local\Programs\Python\Python35\lib\site-packages\tweepy-3.6.0-py3.5.egg\tweepy\streaming.py", line 294, in _run
raise exception
File "C:\Users\KORKUSUZ\AppData\Local\Programs\Python\Python35\lib\site-packages\tweepy-3.6.0-py3.5.egg\tweepy\streaming.py", line 263, in _run
self._read_loop(resp)
File "C:\Users\KORKUSUZ\AppData\Local\Programs\Python\Python35\lib\site-packages\tweepy-3.6.0-py3.5.egg\tweepy\streaming.py", line 324, in _read_loop
self._data(next_status_obj)
File "C:\Users\KORKUSUZ\AppData\Local\Programs\Python\Python35\lib\site-packages\tweepy-3.6.0-py3.5.egg\tweepy\streaming.py", line 297, in _data
if self.listener.on_data(data) is False:
File "C:\Users\KORKUSUZ\Desktop\twitter-realtime-heatmap-master\tstream.py", line 48, in on_data
col.insert(json.loads(data))
File "C:\Users\KORKUSUZ\AppData\Local\Programs\Python\Python35\lib\site-packages\pymongo-3.2.2-py3.5-win-amd64.egg\pymongo\collection.py", line 2203, in insert
with self._socket_for_writes() as sock_info:
File "C:\Users\KORKUSUZ\AppData\Local\Programs\Python\Python35\lib\contextlib.py", line 59, in __enter__
return next(self.gen)
File "C:\Users\KORKUSUZ\AppData\Local\Programs\Python\Python35\lib\site-packages\pymongo-3.2.2-py3.5-win-amd64.egg\pymongo\mongo_client.py", line 716, in _get_socket
server = self._get_topology().select_server(selector)
File "C:\Users\KORKUSUZ\AppData\Local\Programs\Python\Python35\lib\site-packages\pymongo-3.2.2-py3.5-win-amd64.egg\pymongo\topology.py", line 142, in select_server
address))
File "C:\Users\KORKUSUZ\AppData\Local\Programs\Python\Python35\lib\site-packages\pymongo-3.2.2-py3.5-win-amd64.egg\pymongo\topology.py", line 118, in select_servers
self._error_message(selector))
pymongo.errors.ServerSelectionTimeoutError: localhost:27017: [WinError 10061] Failed to connect to the target machine actively refused because
【问题讨论】:
标签: python python-3.x pymongo tweepy