LoginSignup
2
0

More than 3 years have passed since last update.

pymatgenの中のMPResterがimport出来ない時の対処

Posted at

これが初投稿になります。お手柔らかにお願いします。

マテリアルズインフォマティクスの勉強を進めるに当たり、こちらの記事を参考にしていたのですが、

from pymatgen import MPRester

のところでエラーが起きました。
試行錯誤した結果、どうやらpymatgenのバージョンの違いが原因のようです。

こちらがpymatgenを提供している公式サイトのバージョンに関するページですが、これによると、バージョン2021.3.4からは

from pymatgen import Composition  => from pymatgen.core.composition import Composition
from pymatgen import Lattice  => from pymatgen.core.lattice import Lattice
from pymatgen import SymmOp  => from pymatgen.core.operations import SymmOp
from pymatgen import DummySpecie, DummySpecies, Element, Specie, Species  => from pymatgen.core.periodic_table ...
from pymatgen import PeriodicSite, Site  => from pymatgen.core.sites ...
from pymatgen import IMolecule, IStructure, Molecule, Structure  => from pymatgen.core.structure ...
from pymatgen import ArrayWithUnit, FloatWithUnit, Unit  => from pymatgen.core.units ...
from pymatgen import Orbital, Spin  => from pymatgen.electronic_structure.core ...
from pymatgen import MPRester  => from pymatgen.ext.matproj ...

になるようです。...はimport以下の略です。

ご参考までに。

2
0
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
0