简体   繁体   English

ipython 没有错误,jupyter 有错误 ModuleNotFoundError: No module named 'ruamel'

[英]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.

相关问题 ModuleNotFoundError:没有名为“ruamel”的模块 - ModuleNotFoundError: No module named 'ruamel' Jupyter 笔记本错误 ModuleNotFoundError:没有名为“datascience”的模块 - Jupyter notebook error ModuleNotFoundError: No module named 'datascience' ModuleNotFoundError: 没有名为“Ipython”的模块 - ModuleNotFoundError: No module named 'Ipython' Spark 错误:“ModuleNotFoundError: No module named 'notebook'”即使安装了 jupyter - Spark Error: “ModuleNotFoundError: No module named 'notebook'” even when jupyter is installed Jupyter Notebook 错误-ModuleNotFoundError: No module named 'selenium' - Jupyter Notebook error-ModuleNotFoundError: No module named 'selenium' 错误:ModuleNotFoundError:spyder 中没有名为“torch”的模块,在 jupyter notebook 中工作正常 - Error: ModuleNotFoundError: No module named 'torch' in spyder, works fine in jupyter notebook Jupyter 中的“No Module Named”错误 - "No Module Named" error in Jupyter ModuleNotFoundError:没有名为“加密”的模块错误 - ModuleNotFoundError: No module named 'Crypto' Error ModuleNotFoundError:没有名为“citipy”的模块错误 - ModuleNotFoundError: No module named 'citipy' error ModuleNotFoundError:没有名为“yaml”的模块错误 - ModuleNotFoundError: No module named 'yaml' error
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM