python-bson-streaming icon indicating copy to clipboard operation
python-bson-streaming copied to clipboard

Not able to import

Open harik68 opened this issue 7 years ago • 1 comments

If I use the command

from bsonstream import KeyValueBSONInput

I am getting the folliowing error


ImportError Traceback (most recent call last) in () ----> 1 from bsonstream import KeyValueBSONInput

build/bdist.macosx-10.7-x86_64/egg/bsonstream/init.py in ()

ImportError: cannot import name InvalidBSON

What is the solution?

harik68 avatar Aug 16 '17 19:08 harik68

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.

bauman avatar Aug 18 '17 02:08 bauman