Installation issue

77 views
Skip to first unread message

Ziqi Cui

unread,
Feb 17, 2024, 1:00:26 PM2/17/24
to PyCDT forum
Hi all,

I've successfully installed PyCDT v2.0.2 and v2.0.0, but when I tried to run command lines like pycdt generate_input, it indicates pycdt not found! I've also export the path to my .bashrc file. I checked the package bin directory, there doesn't seem to have pycdt script. I think that's the reason why I cannot use command line.

Does anyone have any idea how to fix this issue?

Thank you so much.

Bharat Medasani

unread,
Feb 17, 2024, 1:09:04 PM2/17/24
to Ziqi Cui, PyCDT forum
Did you try installation of pycdt in a virtual environment?

--
You received this message because you are subscribed to the Google Groups "PyCDT forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pycdt-forum...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pycdt-forum/cf24ce57-b643-446e-9b50-dd5caeba80d9n%40googlegroups.com.

calvin...@gmail.com

unread,
Feb 19, 2024, 11:08:13 AM2/19/24
to Bharat Medasani, PyCDT forum
Hi,

I later fixed this error. But another error came up. When I try to generate input files, it always asks me for MPAI, I input my MPAI but it doesn't work. Is there any way that I can avoid using Materials Project and generate the input files?



------------------ Original ------------------
From: Bharat Medasani <mbk...@gmail.com>
Date: Sat, Feb 17, 2024 1:08 PM
To: Ziqi Cui <calvin...@gmail.com>
Cc: PyCDT forum <pycdt...@googlegroups.com>
Subject: Re: Installation issue

Bharat Medasani

unread,
Feb 19, 2024, 11:10:10 AM2/19/24
to calvin...@gmail.com, PyCDT forum
If you have a structure file, you don't have to use MPAI. 

Bharat Medasani

Ziqi Cui

unread,
Feb 20, 2024, 3:42:11 PM2/20/24
to Bharat Medasani, PyCDT forum
Hi Bharat,

I have a CONTCAR as structure file and I run pycdt with the following command: 

 pycdt generate_input --structure_file=/VN1vac_benchmark/CONTCAR  -n 216

However, I got the following errors, which I don't understand.

MPID: None
structure file: /scratch/ziqicui/Ti8V4N10validate/VN1vac_benchmark/CONTCAR
Max. no of atoms in the supercell supercell: 216
oxi_state: None
oxi_range: None
antisites: True
struct_type: semiconductor
include_interstitials?: False
interstitials elements: []
/home/ziqicui/py3.8/lib/python3.8/site-packages/spglib/spglib.py:149: DeprecationWarning: Use get_magnetic_symmetry() for cell with magnetic moments.
  warnings.warn(
Setting up defects...

Number of jobs created:
    bulk = 1
    vacancies:
        vac_1_V = 7
        vac_2_N = 7
    substitutions:
        as_1_N_on_V = 7
        as_1_V_on_N = 7
Total (non dielectric) jobs created = 29

/home/ziqicui/py3.8/lib/python3.8/site-packages/pymatgen/io/vasp/sets.py:430: FutureWarning: 'potcar_functional' argument is deprecated. Use 'user_potcar_functional' instead.
  warnings.warn(
ERROR in running PyCDT:
PyCDT is a script that generates vasp input files, parses vasp output files, and computes the formation energy of charged defects.

This script works based on several sub-commands with their own options. To see the options for sub-commands, type: pycdt -h
Traceback (most recent call last):
  File "/home/ziqicui/py3.8/lib/python3.8/site-packages/pycdt-2.0.5-py3.8.egg/EGG-INFO/scripts/pycdt", line 545, in main
    args.func(args)
  File "/home/ziqicui/py3.8/lib/python3.8/site-packages/pycdt-2.0.5-py3.8.egg/EGG-INFO/scripts/pycdt", line 155, in generate_input
    make_vasp_dielectric_files(prim_struct, user_settings=settings)
  File "/home/ziqicui/py3.8/lib/python3.8/site-packages/pycdt-2.0.5-py3.8.egg/pycdt/utils/vasp.py", line 568, in make_vasp_dielectric_files
    dielectric_set.write_input(path)
  File "/home/ziqicui/py3.8/lib/python3.8/site-packages/pymatgen/io/vasp/sets.py", line 730, in write_input
    super().write_input(
  File "/home/ziqicui/py3.8/lib/python3.8/site-packages/pymatgen/io/vasp/sets.py", line 214, in write_input
    vinput = self.get_vasp_input()
  File "/home/ziqicui/py3.8/lib/python3.8/site-packages/pymatgen/io/vasp/sets.py", line 169, in get_vasp_input
    potcar=self.potcar,
  File "/home/ziqicui/py3.8/lib/python3.8/site-packages/pycdt-2.0.5-py3.8.egg/pycdt/utils/vasp.py", line 229, in potcar
    return PotcarMod(symbols=self.potcar_symbols,
  File "/home/ziqicui/py3.8/lib/python3.8/site-packages/pycdt-2.0.5-py3.8.egg/pycdt/utils/vasp.py", line 83, in __init__
    super(self.__class__, self).__init__(**kwargs)
  File "/home/ziqicui/py3.8/lib/python3.8/site-packages/pymatgen/io/vasp/inputs.py", line 2174, in __init__
    self.set_symbols(symbols, functional, sym_potcar_map)
  File "/home/ziqicui/py3.8/lib/python3.8/site-packages/pycdt-2.0.5-py3.8.egg/pycdt/utils/vasp.py", line 107, in set_symbols
    p = PotcarSingleMod.from_symbol_and_functional(el, functional)
  File "/home/ziqicui/py3.8/lib/python3.8/site-packages/pycdt-2.0.5-py3.8.egg/pycdt/utils/vasp.py", line 48, in from_symbol_and_functional
    if not os.path.isdir(os.path.join(
  File "/cvmfs/soft.computecanada.ca/easybuild/software/2020/avx2/Core/python/3.8.10/lib/python3.8/posixpath.py", line 76, in join
    a = os.fspath(a)
TypeError: expected str, bytes or os.PathLike object, not NoneType
ERROR - root - ERROR in running PyCDT:
PyCDT is a script that generates vasp input files, parses vasp output files, and computes the formation energy of charged defects.

This script works based on several sub-commands with their own options. To see the options for sub-commands, type: pycdt -h
Traceback (most recent call last):
  File "/home/ziqicui/py3.8/lib/python3.8/site-packages/pycdt-2.0.5-py3.8.egg/EGG-INFO/scripts/pycdt", line 545, in main
    args.func(args)
  File "/home/ziqicui/py3.8/lib/python3.8/site-packages/pycdt-2.0.5-py3.8.egg/EGG-INFO/scripts/pycdt", line 155, in generate_input
    make_vasp_dielectric_files(prim_struct, user_settings=settings)
  File "/home/ziqicui/py3.8/lib/python3.8/site-packages/pycdt-2.0.5-py3.8.egg/pycdt/utils/vasp.py", line 568, in make_vasp_dielectric_files
    dielectric_set.write_input(path)
  File "/home/ziqicui/py3.8/lib/python3.8/site-packages/pymatgen/io/vasp/sets.py", line 730, in write_input
    super().write_input(
  File "/home/ziqicui/py3.8/lib/python3.8/site-packages/pymatgen/io/vasp/sets.py", line 214, in write_input
    vinput = self.get_vasp_input()
  File "/home/ziqicui/py3.8/lib/python3.8/site-packages/pymatgen/io/vasp/sets.py", line 169, in get_vasp_input
    potcar=self.potcar,
  File "/home/ziqicui/py3.8/lib/python3.8/site-packages/pycdt-2.0.5-py3.8.egg/pycdt/utils/vasp.py", line 229, in potcar
    return PotcarMod(symbols=self.potcar_symbols,
  File "/home/ziqicui/py3.8/lib/python3.8/site-packages/pycdt-2.0.5-py3.8.egg/pycdt/utils/vasp.py", line 83, in __init__
    super(self.__class__, self).__init__(**kwargs)
  File "/home/ziqicui/py3.8/lib/python3.8/site-packages/pymatgen/io/vasp/inputs.py", line 2174, in __init__
    self.set_symbols(symbols, functional, sym_potcar_map)
  File "/home/ziqicui/py3.8/lib/python3.8/site-packages/pycdt-2.0.5-py3.8.egg/pycdt/utils/vasp.py", line 107, in set_symbols
    p = PotcarSingleMod.from_symbol_and_functional(el, functional)
  File "/home/ziqicui/py3.8/lib/python3.8/site-packages/pycdt-2.0.5-py3.8.egg/pycdt/utils/vasp.py", line 48, in from_symbol_and_functional
    if not os.path.isdir(os.path.join(
  File "/cvmfs/soft.computecanada.ca/easybuild/software/2020/avx2/Core/python/3.8.10/lib/python3.8/posixpath.py", line 76, in join
    a = os.fspath(a)
TypeError: expected str, bytes or os.PathLike object, not NoneType

Can you explain what is the reason of this?

Thank you so much.

Bharat Medasani

unread,
Feb 20, 2024, 7:55:50 PM2/20/24
to Ziqi Cui, PyCDT forum
You need to setup the POTCAR directory according to pymatgen instructions. Please read pymatgen documentation on this.

Ziqi Cui

unread,
Feb 21, 2024, 9:27:24 AM2/21/24
to Bharat Medasani, PyCDT forum
Hi Bharat,

Thank you for the reply.

I have successfully set up the POTCAR directory for pymatgen, however I keep getting the following error:

 File "/home/ziqicui/py3.8/bin/pycdt", line 4, in <module>
    __import__('pkg_resources').run_script('pycdt==2.0.5', 'pycdt')
  File "/home/ziqicui/py3.8/lib/python3.8/site-packages/pkg_resources/__init__.py", line 672, in run_script
    self.require(requires)[0].run_script(script_name, ns)
  File "/home/ziqicui/py3.8/lib/python3.8/site-packages/pkg_resources/__init__.py", line 1472, in run_script
    exec(code, namespace, namespace)
  File "/home/ziqicui/py3.8/lib/python3.8/site-packages/pycdt-2.0.5-py3.8.egg/EGG-INFO/scripts/pycdt", line 32, in <module>
    from pymatgen.ext.matproj import MPRester
  File "/home/ziqicui/py3.8/lib/python3.8/site-packages/pymatgen/ext/matproj.py", line 37, in <module>
    from pymatgen.core import SETTINGS, SETTINGS_FILE
  File "/home/ziqicui/py3.8/lib/python3.8/site-packages/pymatgen/core/__init__.py", line 62, in <module>
    SETTINGS = _load_pmg_settings()
  File "/home/ziqicui/py3.8/lib/python3.8/site-packages/pymatgen/core/__init__.py", line 52, in _load_pmg_settings
    d.update(d_yml)
TypeError: 'NoneType' object is not iterable


Do you have any idea what's the reason of it?

Thank you so much.

Bharat Medasani

unread,
Feb 21, 2024, 9:36:22 AM2/21/24
to Ziqi Cui, PyCDT forum
It is due to the MP API token. Can you try using older version API token?


calvin...@gmail.com

unread,
Feb 21, 2024, 10:01:17 AM2/21/24
to Bharat Medasani, PyCDT forum
Hi Bharat,

I actually didn't input MP API in the command line since I have CONTCAR as structure. I tried inputting both the new and older version MP API in the command line, neither of them works.

Is there another way to fix this?

Thank you so much.



------------------ Original ------------------
From: Bharat Medasani <mbk...@gmail.com>
Date: Wed, Feb 21, 2024 9:36 AM

Bharat Medasani

unread,
Feb 21, 2024, 10:03:19 AM2/21/24
to calvin...@gmail.com, PyCDT forum
Please send your CONTCAR. I will investigate this.

Bharat Medasani

Ziqi Cui

unread,
Feb 21, 2024, 2:10:42 PM2/21/24
to Bharat Medasani, PyCDT forum
Hi Bharat,

Here's my CONTCAR file. And the command I use is:  pycdt generate_input --structure_file=CONTCAR -n 216

Thank you so much.
CONTCAR
Reply all
Reply to author
Forward
0 new messages