Search code examples
pythonpymongotornado-motor

Can't access attribute 'test' on MotorClient before calling open() or open_sync()


I was following some Motor examples and they are giving me trouble. I'm using Python2.7 in virtualenv with tornado 3.2, pymongo 2.5.0 and motor 0.1.2. All the examples are throwing the same error.


Solution

  • You're using the "stable" version of Motor, 0.1.2, but following the "latest" examples which are built off the master branch in GitHub. Follow the "stable" examples and they'll show you how to call open_sync:

    http://motor.readthedocs.org/en/stable/tutorial.html#creating-a-client