ImportError when using abicheck.py with abipy and pymatgen

57 Views Asked by At

Hi Stack Overflow community,

I'm encountering an issue when trying to use abicheck.py with the abipy and pymatgen libraries in my abienv conda environment. Here's the command I'm running and the error I'm facing:

Command:

(abienv) mtk@mtk-HP-EliteBook-x360-1030-G2:~/abipy$ abicheck.py --with-flow

Error :

/home/mtk/miniconda3/envs/abienv/bin/abicheck.py:4: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
  __import__('pkg_resources').run_script('abipy==0.9.3', 'abicheck.py')
Traceback (most recent call last):
  File "/home/mtk/miniconda3/envs/abienv/bin/abicheck.py", line 4, in <module>
    __import__('pkg_resources').run_script('abipy==0.9.3', 'abicheck.py')
  File "/home/mtk/miniconda3/envs/abienv/lib/python3.9/site-packages/pkg_resources/__init__.py", line 722, in run_script
    self.require(requires)[0].run_script(script_name, ns)
  File "/home/mtk/miniconda3/envs/abienv/lib/python3.9/site-packages/pkg_resources/__init__.py", line 1561, in run_script
    exec(code, namespace, namespace)
  File "/home/mtk/miniconda3/envs/abienv/lib/python3.9/site-packages/abipy-0.9.3-py3.9.egg/EGG-INFO/scripts/abicheck.py", line 11, in <module>
    import abipy.flowtk as flowtk
  File "/home/mtk/miniconda3/envs/abienv/lib/python3.9/site-packages/abipy-0.9.3-py3.9.egg/abipy/flowtk/__init__.py", line 15, in <module>
    from .tasks import *
  File "/home/mtk/miniconda3/envs/abienv/lib/python3.9/site-packages/abipy-0.9.3-py3.9.egg/abipy/flowtk/tasks.py", line 36, in <module>
    from .abitimer import AbinitTimerParser
  File "/home/mtk/miniconda3/envs/abienv/lib/python3.9/site-packages/abipy-0.9.3-py3.9.egg/abipy/flowtk/abitimer.py", line 2, in <module>
    from pymatgen.io.abinit.abitimer import AbinitTimerParserError, AbinitTimerParser, AbinitTimerSection
ImportError: cannot import name 'AbinitTimerParserError' from 'pymatgen.io.abinit.abitimer' (/home/mtk/miniconda3/envs/abienv/lib/python3.9/site-packages/pymatgen/io/abinit/abitimer.py)

It seems that the AbinitTimerParserError class is not being imported from the pymatgen.io.abinit.abitimer module, causing the ImportError. I have already checked that both abipy and pymatgen are installed in my abienv environment.

I have tried updating both abipy and pymatgen using conda update, but the issue persists. I'm using Python 3.9.

Any suggestions on how to resolve this issue would be greatly appreciated. Thank you in advance for your help!

Best regards, MTK

0

There are 0 best solutions below