jupyter notebook - ImportError: No module named 'bson'

jupyter notebook - ImportError: No module named 'bson'

尝试使用一些 jupyter notebook,我遇到了 bson 模块的问题,如错误中所报告的那样,接缝不可用:"ImportError: No module named 'bson'"

我 运行 jupyter notebook 4.3.0 在 python 2.7 内核上,可在专用虚拟环境中使用。我尝试通过一个简单的 "conda install bson" 手动安装 bson 模块,但它不在 official/standard 存储库中,所以我不得不安装 OpenMDAO/bson。最后,它没有改变问题。我知道该模块可能来自 pymongo 包,所以我尝试安装并得到相同的结果。

这里有什么提示吗? bson和pymongo之间的link是什么?

您可以建议这个答案:import error: no module named bson

其中指出:

If you don't get the no module named bson error but the EPOCH_AWARE import error, this is due to a name clash between bson and pymongo.
In this case, you should do these in order:

sudo pip uninstall bson
sudo pip uninstall pymongo
sudo pip install pymongo

对于你的情况,尝试从一个新的 virtualenv 开始,并按照给定的顺序执行上述操作

这也回答了 bson 和 pymongo 之间的 link。