Comments (6)
This is perhaps not yet solved?
bson.BSON(item_data).decode()
gives me
AttributeError: module 'bson' has no attribute 'BSON'
using bson 0.5.10
from bson.
see mongodb's bson module
from bson.
Thank you, it might have been a stupid question. It was and is confusing that both pymongo and bson packages need the same import bson
statement when you want to read bson. If you have both bson and pymongo installed, import bson
will only import the pymongo version (e.g. bson.loads() is not accessible, thus the bson packages are not merged together). You would need to uninstall pymongo just to get the import bson
from here again and not the pymongo import bson
package. For those who need pymongo: https://pypi.org/project/pymongo/
from bson.
I'm testing another name pybson
. you can install and use that name.
from bson.
I have used pip uninstall bson
and pip install pybson
now so that I can use import pybson as bson
when I want the old name back. If I accidentally need both pymongo's and pybson's import bson
, I can use aliases. Thanks.
from bson.
I have installed a new system, using anaconda as the base. In Spyder, even though I had installed bson using pip install pybson
, it said:
Traceback (most recent call last):
File "", line 1, in
import pybson # same as bsonFile "C:\Users\Admin\anaconda3\lib\site-packages\pybson_init_.py", line 23, in
from .objectid import ObjectIdFile "C:\Users\Admin\anaconda3\lib\site-packages\pybson\objectid.py", line 30, in
from bson.py3compat import PY3, bytes_from_hex, string_type, text_typeModuleNotFoundError: No module named 'bson'
After installing pymongo in addition to pybson, using conda install pymongo
, the import pybson
statement worked. Why?
from bson.
Related Issues (20)
- UnknownSerializerError has no helpful debugging information
- bson.decode_all() not working anymore HOT 2
- Missing element_type 0x13: decimal128
- import error HOT 2
- Enums are not supported
- Can't serialize ObjectId HOT 1
- Tag the source HOT 1
- PyPI source distribution missing LICENSE HOT 2
- Missing git tags for versions 0.5.9 and 0.5.10 HOT 1
- Feature request: add type hints support HOT 1
- Drop python 2 and add annotations HOT 1
- Suggestions for "UnicodeEncodeError: 'utf-8' codec can't encode character"
- Support top level arrays
- 0.5.10: pytest warnings
- 0.5.10: use of `bson` module fails with `cannot import name 'CodecOptions' from 'bson' `
- Use GitHub actions for testing
- Maintain one to one match with original Mongo code HOT 2
- 3.12 issue - setuptools must be explicitly listed in dependencies
- encode_cstring raises UnicodeEncodeError on Python 2 with non-ASCII Unicode values HOT 1
- Attribute err HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bson.