[英]ipython no error, jupyter has error ModuleNotFoundError: No module named 'ruamel'
I am running a Python package called pymatgen in Jupyter.我在 Jupyter 中运行名为 pymatgen 的 Python package。 Jupyter and pymatgen are installed in a conda environment. Jupyter 和 pymatgen 安装在 conda 环境中。 I have manually installed ruamel using conda's python3, but the same error occurs.我已经使用 conda 的 python3 手动安装了 ruamel,但是发生了同样的错误。 The strange thing is that the same code (in this case just a library load statement) gives no errors when run with ipython.奇怪的是,相同的代码(在这种情况下只是一个库加载语句)在使用 ipython 运行时没有给出错误。 Both Jupyter and ipython are running from the miniconda installation (I check with the command which). Jupyter 和 ipython 都从 miniconda 安装中运行(我使用命令 which 进行检查)。 I noticed some postings on the web stating that ruamel has problems with conda due to the remapping of a "."我注意到 web 上的一些帖子指出,由于重新映射“。”,ruamel 与 conda 存在问题。 to an underscore character, but none of the proposed solutions helped the above problem.到下划线字符,但所提出的解决方案都没有解决上述问题。 I also don't understand why ipython is fine and Jupyter fails.我也不明白为什么 ipython 很好而 Jupyter 失败了。 Any suggestions?有什么建议么?
from pymatgen.core.structure import Structure, Lattice
from pymatgen.core.periodic_table import Element
---------------------------------------------------------------------------
ModuleNotFoundError Traceback (most recent call last)
<ipython-input-1-753da7cc5963> in <module>
----> 1 from pymatgen.core.structure import Structure, Lattice
2 from pymatgen.core.periodic_table import Element
~/.local/lib/python3.7/site-packages/pymatgen/__init__.py in <module>
13 import os
14 import warnings
---> 15 import ruamel.yaml as yaml
16 from fnmatch import fnmatch
17
ModuleNotFoundError: No module named 'ruamel'
pip install ruamel.yaml pip 安装 ruamel.yaml
Use the above command to install it使用上面的命令安装它
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.