0

I am running a Python package called pymatgen in Jupyter. Jupyter and pymatgen are installed in a conda environment. I have manually installed ruamel using conda's python3, but the same error occurs. The strange thing is that the same code (in this case just a library load statement) gives no errors when run with ipython. Both Jupyter and ipython are running from the miniconda installation (I check with the command which). I noticed some postings on the web stating that ruamel has problems with conda due to the remapping of a "." 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. 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'
4

1 回答 1

0

使用以下命令安装它:

pip install ruamel.yaml
于 2021-12-20T09:49:35.493 回答