Importing pymongo on OpenShift
Question: My OpenShift application, which is written in Python with a MongoDB database,
is failing to import pymongo. My logs say

    
    
    import pymongo
    [Fri Jun 05 12:11:01 2015] [error] [client 127.10.149.1]   File "/var/lib/openshift/55706c785973ca947100005a/python/virtenv/lib/python2.7/site-packages/pymongo/__init__.py", line 83, in <module>
    [Fri Jun 05 12:11:01 2015] [error] [client 127.10.149.1]     from pymongo.collection import ReturnDocument
    [Fri Jun 05 12:11:01 2015] [error] [client 127.10.149.1]   File "/var/lib/openshift/55706c785973ca947100005a/python/virtenv/lib/python2.7/site-packages/pymongo/collection.py", line 28, in <module>
    [Fri Jun 05 12:11:01 2015] [error] [client 127.10.149.1]     from pymongo import (common,
    [Fri Jun 05 12:11:01 2015] [error] [client 127.10.149.1] ImportError: cannot import name common
    

I can't find any mention of "common" in the pymongo documentation. Any idea
what I need to do to fix this?


Answer: It was an installation problem.

To fix it, I logged in using ssh, uninstalled pymongo and bson, made sure bson
wasn't in requirements.txt, and pushed a change.

This did a clean install of pymongo.

