python - When I use pymongo2.8, There is a error(pymongo.errors.OperationFailure: None) -
when run code this:
#!/bin/env python #encoding:utf-8 import sys sys.path.append('/usr/lib64/python2.7/site-packages') print sys.path pymongo import mongoclient client = mongoclient('localhost', 27017) db = client.guping
the output is:
traceback (most recent call last): file "test_mongo.py", line 8, in <module> client = mongoclient('localhost', 27017) file "/usr/lib64/python2.7/site-packages/pymongo/mongo_client.py", line 374, in __init__ self._ensure_connected(true) file "/usr/lib64/python2.7/site-packages/pymongo/mongo_client.py", line 939, in _ensure_connected self.__ensure_member() file "/usr/lib64/python2.7/site-packages/pymongo/mongo_client.py", line 813, in __ensure_member member, nodes = self.__find_node() file "/usr/lib64/python2.7/site-packages/pymongo/mongo_client.py", line 873, in __find_node member, nodes = self.__try_node(candidate) file "/usr/lib64/python2.7/site-packages/pymongo/mongo_client.py", line 720, in __try_node {'ismaster': 1}) file "/usr/lib64/python2.7/site-packages/pymongo/mongo_client.py", line 703, in __simple_command helpers._check_command_response(response, none, msg) file "/usr/lib64/python2.7/site-packages/pymongo/helpers.py", line 133, in _check_command_response response) pymongo.errors.operationfailure: none
the env:
- python 2.7
- pymongo 2.8
when run code on windows8, it's worked run on vps(centos),there wrong
i use pymongo 3.0.2 , there error this: pymongo.errors.serverselectiontimeouterror: no servers found yet
i can't solve it, change pymongo 2.8
but there still err...
i hope can me.
Comments
Post a Comment