I am invoking the following simple script to connect to a mongo database through Python.
This is an example from the 10gen training course M101 - MongoDB for developers , and according to the forums, I am not the only person who has this problem.
import pymongo from pymongo import Connection connection = Connection('localhost', 27017)
I installed pymongo with pip as described here and everything worked fine. Now when I try to import the Connection class, it throws the following error:
ImportError: cannot import name Connection
I reviewed the following thread: pymongo is installed, but the import is complete
but this does not apply to my environment, since I am using Python 2.7.1, and I'm on Mac OS instead of CentOS. I also did some research on Google, but the only thing that I have found out so far is to verify that PyMongo was installed correctly, which I did and returns:
Requirement already satisfied
Any help would be appreciated to move on during the course. Thanks in advance.
source share