From mp_api.client import MPRester gives error

this the error i got:

Traceback (most recent call last):
File “”, line 1, in
File “/opt/anaconda3/envs/fresh_env/lib/python3.9/site-packages/mp_api/client/init.py”, line 8, in
from .mprester import MPRester
File “/opt/anaconda3/envs/fresh_env/lib/python3.9/site-packages/mp_api/client/mprester.py”, line 11, in
from emmet.core.electronic_structure import BSPathType
File “/opt/anaconda3/envs/fresh_env/lib/python3.9/site-packages/emmet/core/electronic_structure.py”, line 26, in
from emmet.core.material_property import PropertyDoc
File “/opt/anaconda3/envs/fresh_env/lib/python3.9/site-packages/emmet/core/material_property.py”, line 10, in
from emmet.core.material import PropertyOrigin
File “/opt/anaconda3/envs/fresh_env/lib/python3.9/site-packages/emmet/core/material.py”, line 13, in
from emmet.core.structure import MoleculeMetadata, StructureMetadata
File “/opt/anaconda3/envs/fresh_env/lib/python3.9/site-packages/emmet/core/structure.py”, line 13, in
from emmet.core.symmetry import PointGroupData, SymmetryData
File “/opt/anaconda3/envs/fresh_env/lib/python3.9/site-packages/emmet/core/symmetry.py”, line 6, in
from pymatgen.symmetry.analyzer import (
ImportError: cannot import name ‘SymmetryUndeterminedError’ from ‘pymatgen.symmetry.analyzer’ (/opt/anaconda3/envs/fresh_env/lib/python3.9/site-packages/pymatgen/symmetry/analyzer.py)

please help!!

You might have to upgrade your pymatgen version. Make sure to run the latest version.

my version is pymatgen-2024.8.9. Isn’t this the latest version?
or should I degrade the version??

when I use jupyter notebook to run the code
from mp_api.client import MPRester
the error I get is as follows:
ImportError: cannot import name ‘SymmetryUndeterminedError’ from ‘pymatgen.symmetry.analyzer’ (/opt/anaconda3/envs/fresh_env/lib/python3.9/site-packages/pymatgen/symmetry/analyzer.py)

its that same error

I get the same error as well using pymatgen-2024.8.9. with python3.9

The latest pymatgen version is 2024.10.29. You might have to upgrade your python version to 3.10 or later.

Thank you. Resolved when I upgraded to python 3.12