【发布时间】:2020-08-02 19:46:00
【问题描述】:
错误代码: 客户端 = pymongo.MongoClient("mongodb+srv://********?retryWrites=true&w=majority") init 中的文件“/home/ubuntu/.local/lib/python3.6/site-packages/pymongo/mongo_client.py”,第 621 行 连接超时=超时) 文件“/home/ubuntu/.local/lib/python3.6/site-packages/pymongo/uri_parser.py”,第 463 行,在 parse_uri 节点 = dns_resolver.get_hosts() 文件“/home/ubuntu/.local/lib/python3.6/site-packages/pymongo/srv_resolver.py”,第 102 行,在 get_hosts _, 节点 = self._get_srv_response_and_hosts(True) _get_srv_response_and_hosts 中的文件“/home/ubuntu/.local/lib/python3.6/site-packages/pymongo/srv_resolver.py”,第 83 行 结果 = self._resolve_uri(encapsulate_errors) _resolve_uri 中的文件“/home/ubuntu/.local/lib/python3.6/site-packages/pymongo/srv_resolver.py”,第 79 行 引发 ConfigurationError(str(exc)) pymongo.errors.ConfigurationError: query() got an unexpected keyword argument 'lifetime'
版本: 蟒蛇 3 pymongo:3.10.1
【问题讨论】:
-
你可能需要安装
dsnpython和pip install dsnpython --user