-
Notifications
You must be signed in to change notification settings - Fork 83
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
importing json_utils issues ImportError #19
Comments
I'm having this problem as well. Anyone find a fix? |
The same problem here! With pymongo it works fine, but when I installed bson directly via pip ( pip install bson ) it gave me this problem! to fix this I've uninstalled bson and pymongo and then reinstalled only pymongo! This is just a workaround... not a real fix 👎 |
The problem is that there are two projects (i.e. things you install with pip install project) that have a conflict in Python package names (things you import). pymongo installs pymongo, gridfs and bson, and this bson project also installs a bson package. PyPI does not detect these conflicts; installers could but I think they don’t. The best thing for users would be for this bson project to rename the Python package it installs. |
@merwok's response is correct. To fix ... Uninstall and reinstall:
The conflicting bson package overwrites the pymongo bson package. Need to clean it and re-install pymongo. |
Hi @wshayes , But I get a new error:`ImportError Traceback (most recent call last) ~\Anaconda3\lib\site-packages\bson\json_util.py in () ~\Anaconda3\lib\site-packages\pymongo_init_.py in () ~\Anaconda3\lib\site-packages\pymongo\collection.py in () ImportError: cannot import name 'abc'` From here I don't know how to move forward. |
That’s a different error that would need its own ticket to catch the attention of maintainers. |
pybson has not json_util. You may confuse with mongo's bson. |
If you're still getting this error: Anyone knows a better solution please add. |
pip install python -bsonstream |
In [2]: from bson import json_util
ImportError Traceback (most recent call last)
in ()
----> 1 from bson import json_util
/home/lhonda/.virtualenvs/test/local/lib/python2.7/site-packages/bson/json_util.py in ()
84
85 import bson
---> 86 from bson import EPOCH_AWARE
87 from bson.binary import Binary
88 from bson.code import Code
ImportError: cannot import name EPOCH_AWARE
In [3]:
The text was updated successfully, but these errors were encountered: