为了账号安全,请及时绑定邮箱和手机立即绑定

pymongo.errors.ServerSelectionTimeoutError: 192.168.1.101:27017: [WinError 10061] 由于目标计算机积极拒绝,无法连接。可我明明开启mongodb服务了的,而且在可视化软件里面也能看到别的数据库,这是怎么回事呢?

['douban.pipelines.DoubanPipeline']

2019-04-11 17:34:06 [scrapy.core.engine] INFO: Spider opened

2019-04-11 17:34:06 [scrapy.extensions.logstats] INFO: Crawled 0 pages (at 0 pages/min), scraped 0 items (at 0 items/min)

2019-04-11 17:34:06 [scrapy.extensions.telnet] INFO: Telnet console listening on 127.0.0.1:6023

2019-04-11 17:34:06 [scrapy.core.engine] DEBUG: Crawled (200) <GET https://movie.douban.com/top250> (referer: None)

2019-04-11 17:34:36 [scrapy.core.scraper] ERROR: Error processing {'describe': '希望让人自由。',

 'evaluate': '1387301人评价',

 'introduce': '1994/美国/犯罪剧情',

 'movie_name': '肖申克的救赎',

 'serial_number': '1',

 'star': '9.6'}

Traceback (most recent call last):

  File "E:\python\lib\site-packages\twisted\internet\defer.py", line 654, in _runCallbacks

    current.result = callback(current.result, *args, **kw)

  File "C:\Users\star\douban\douban\pipelines.py", line 24, in process_item

    self.post.insert(data)

  File "E:\python\lib\site-packages\pymongo\collection.py", line 3161, in insert

    check_keys, manipulate, write_concern)

  File "E:\python\lib\site-packages\pymongo\collection.py", line 607, in _insert

    bypass_doc_val, session)

  File "E:\python\lib\site-packages\pymongo\collection.py", line 595, in _insert_one

    acknowledged, _insert_command, session)

  File "E:\python\lib\site-packages\pymongo\mongo_client.py", line 1247, in _retryable_write

    with self._tmp_session(session) as s:

  File "E:\python\lib\contextlib.py", line 81, in __enter__

    return next(self.gen)

  File "E:\python\lib\site-packages\pymongo\mongo_client.py", line 1576, in _tmp_session

    s = self._ensure_session(session)

  File "E:\python\lib\site-packages\pymongo\mongo_client.py", line 1563, in _ensure_session

    return self.__start_session(True, causal_consistency=False)

  File "E:\python\lib\site-packages\pymongo\mongo_client.py", line 1516, in __start_session

    server_session = self._get_server_session()

  File "E:\python\lib\site-packages\pymongo\mongo_client.py", line 1549, in _get_server_session

    return self._topology.get_server_session()

  File "E:\python\lib\site-packages\pymongo\topology.py", line 427, in get_server_session

    None)

  File "E:\python\lib\site-packages\pymongo\topology.py", line 199, in _select_servers_loop

    self._error_message(selector))

pymongo.errors.ServerSelectionTimeoutError: 192.168.1.101:27017: [WinError 10061] 由于目标计算机积极拒绝,无法连接。


正在回答

1 回答

已经解决啦,就是把local_host设成127.0.0.1就好啦,我还傻傻的设置了自己的ip hh

0 回复 有任何疑惑可以回复我~
#1

慕瓜9091427

换成127.0.0.1,还是报这个错: pymongo.errors.ServerSelectionTimeoutError: 127.0.0.1:27017: [WinError 10061] 由于目标计算机积极拒绝,无法连接。 请问楼主知道怎么解决不?
2019-04-18 回复 有任何疑惑可以回复我~
#2

慕瓜9091427 回复 慕瓜9091427

已解决
2019-04-18 回复 有任何疑惑可以回复我~
#3

慕丝0467733

你好,则么解决的呀?我还是解决不了 self._error_message(selector)) pymongo.errors.ServerSelectionTimeoutError: localhost:27017: [WinError 10061] 由于目标计算机积极拒绝,无法连接。
2019-05-29 回复 有任何疑惑可以回复我~
#4

慕丝0467733 回复 慕丝0467733

可以帮我看看吗?谢谢
2019-05-29 回复 有任何疑惑可以回复我~
#5

慕丝9017952 回复 慕瓜9091427

怎么解决的啊,能帮帮我ma?
2019-07-24 回复 有任何疑惑可以回复我~
查看2条回复

举报

0/150
提交
取消

pymongo.errors.ServerSelectionTimeoutError: 192.168.1.101:27017: [WinError 10061] 由于目标计算机积极拒绝,无法连接。可我明明开启mongodb服务了的,而且在可视化软件里面也能看到别的数据库,这是怎么回事呢?

我要回答 关注问题
意见反馈 帮助中心 APP下载
官方微信