Unable to find cmake folder when installing lammps python module

I am referring to the quick start to install lammps’ python module on my windows machine. However, I can’t find cmake folder in my lammps directory and therefore the script will not work.

I noticed it requires “cmake” to compile lammps, but I installed lammps through binaries exe and therefore did not use cmake command once.

any suggestion?

If you install LAMMPS from a pre-compiled binary package, you don’t need to install the LAMMPS python module. It is part of the binary package.

You should be able to do in a command prompt window

python -i
from lammps import lammps
lmp = lammps()
print('LAMMPS version', lmp.version())
lmp.close()
quit()

The instructions you are referring to are for cases when you build LAMMPS yourself from the source code.

1 Like

Thank you, it makes sense now!

Just a follow up question, can I write up a python script (*.py) and let lammps read that instead of typing script line by line in a command prompt?

LAMMPS does not read (and execute) Python scripts, only Python does.

Sorry for the confusion. That’s what I meant. I want to execute a python file that uses LAMMPS module, but when I imported the module and tried to execute it, it threw an error.

That is because your script is wrong.

There is no standalone lammps.pylammps.version() function. Only a version() method for the lammps() or PyLammps() or IPyLammps() classes that have to be called from an instantiated class instance. It looks like you need to improve your understanding of how Python works in general.