How to create *.json file of CASTEP

What I would like to do is read CASTEP output files which include energies and geometries using ASE.
I referred to ‘ase.io.castep’ in web manual. ASE can read *.json file instead of *.castep.
When I run CASTEP separately, I didn’t get *.json file.
How can I create *.json file or convert *.castep to *.json?
Thank you for your answer.

Is the function read_castep_castep working for you? Format Specific Options — ASE documentation

I think ‘read_castep_castep’ function is not working for the *.castep file.
The version of CASTEP is 2019, and here is the error log.

read_castep_castep(‘Pt.castep’)
Generating CASTEP keywords JSON file… hang on.
The CASTEP keywords JSON file contains abstractions for CASTEP input
parameters (for both .cell and .param input files), including some
format checks and descriptions. The latter are extracted from the
internal online help facility of a CASTEP binary, thus allowing to
easily keep the calculator synchronized with (different versions of)
the CASTEP code. Consequently, avoiding licensing issues (CASTEP is
distributed commercially by accelrys), we consider it wise not to
provide the file in the first place.

…/site-packages/ase/calculators/castep.py:478: UserWarning: Could not determine the version of your CASTEP binary
This usually means one of the following

  • you do not have CASTEP installed
  • you have not set the CASTEP_COMMAND to call it
  • you have provided a wrong CASTEP_COMMAND.
    Make sure it is in your PATH

warnings.warn(str(e))
Could not find CASTEP label in result file: <_io.TextIOWrapper name=‘Pt.castep’ mode=‘r’ encoding=‘UTF-8’>
Are you sure this is a .castep file?
Traceback (most recent call last):
File “”, line 1, in
File “…/site-packages/ase/io/castep.py”, line 737, in read_castep_castep
calc.read(castep_file=fd)
File “…/site-packages/ase/calculators/castep.py”, line 897, in read
= self._castep_find_last_record(out)
TypeError: ‘NoneType’ object is not iterable