Cif to lammps data file using Lammps-Interface

I have been trying to convert a cif file to lammps data file using lammps-interface module with the following line:
lammps-interface cif_file.cif

But I get the following error during the process:
Traceback (most recent call last):
File “C:\Users\os042090\AppData\Local\Programs\Python\Python312\Lib\site-packages\lammps_interface\CIFIO.py”, line 59, in read
key, val = line.strip().split()
^^^^^^^^
ValueError: not enough values to unpack (expected 2, got 1)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File “”, line 198, in _run_module_as_main
File “”, line 88, in run_code
File "C:\Users\os042090\AppData\Local\Programs\Python\Python312\Scripts\lammps-interface.exe_main
.py", line 7, in
File “C:\Users\os042090\AppData\Local\Programs\Python\Python312\Lib\site-packages\lammps_interface\cli.py”, line 12, in main
cell, graph = from_CIF(options.cif_file)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File “C:\Users\os042090\AppData\Local\Programs\Python\Python312\Lib\site-packages\lammps_interface\structure_data.py”, line 1600, in from_CIF
cifobj.read(cifname)
File “C:\Users\os042090\AppData\Local\Programs\Python\Python312\Lib\site-packages\lammps_interface\CIFIO.py”, line 61, in read
key, val = line.strip().split()[:2]
^^^^^^^^
ValueError: not enough values to unpack (expected 2, got 1)

You are posting in the wrong forum. “Lammps-interface” != LAMMPS.

You need to contact the lammps-interface developers.

Another route to create DATA files is to use the amazing molecular editor GDIS (available on most Linux distributions) to open the CIF file and convert it to a PDB or XYZ. Make sure to change the space group to P1 before proceeding.
With GDIS it is also possible to export supercells and crystal planes. Have fun!

1 Like

Thanks for the information

Thank you very much for your response

Ovito can also load CIF files and write using lammps data format.

1 Like

Recommendation: GIF files can be converted and exported in VESTA to facilitate modeling.