ImportError: cannot import name 'Molecule' from 'pymatgen' (unknown location)

1k Views Asked by At

I am trying to simulate a Si crystal structure with 'pymatgen' in Anaconda3.

import pymatgen

This code runs without error. But when I run the following code-

from pymatgen import Molecule

It gives error "ImportError: cannot import name 'Molecule' from 'pymatgen' (unknown location)" This happens for every other modules. How do I solve this?

1

There are 1 best solutions below

0
On

Are you using a virtual environment? Have you installed the modules in the same environment where you launched the script?

Is possible that Anaconda create automatically a venv when you create your project. If you have a terminal where the script is launched, write:

pip list

and look which modules are installed.