python-bson-streaming
python-bson-streaming copied to clipboard
Not able to import
If I use the command
from bsonstream import KeyValueBSONInput
I am getting the folliowing error
ImportError Traceback (most recent call last)
build/bdist.macosx-10.7-x86_64/egg/bsonstream/init.py in
ImportError: cannot import name InvalidBSON
What is the solution?
sounds like you did
pip install bson
which is a 3rd party and unsupported python-bson module. This module requires the fully supported bson module from the python mongo project.
You should be able to put https://github.com/mongodb/mongo-python-driver/tree/master/bson in your python path
or install the full pymongo driver from pip
pip install pymongo
some linux distributions package the official pymongo bson implementation separate from pymongo itself for exactly this reason. EPEL packages the official supported bson implementation.