-
Type: Bug
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: None
-
None
-
Python Drivers
Install python-bsonjs latest from source and any version of pymongo, then try to import something from bson. It will fail like this:
>>> from bson import encode Traceback (most recent call last): File "<stdin>", line 1, in <module> ImportError: cannot import name 'encode' from 'bson' (unknown location)
bsonjs is shadowing the bson package from pymongo:
>>> import bson >>> bson <module 'bson' (<_frozen_importlib_external.NamespaceLoader object at 0x102f51550>)> >>> dir(bson) ['__doc__', '__file__', '__loader__', '__name__', '__package__', '__path__', '__spec__', 'binary', 'codec_options', 'errors', 'objectid', 'typings', 'tz_util'] >>> bson.__spec__ ModuleSpec(name='bson', loader=<_frozen_importlib_external.NamespaceLoader object at 0x102f51550>, submodule_search_locations=_NamespacePath(['/Users/shane/git/python-bsonjs/src/bson']))
This was caused by PYTHON-3882.
- is caused by
-
PYTHON-3882 [python-bsonjs] Support Python 3.7-3.12
- Closed