Installing Python wrapper for LAMMPS

Dear LAMMPS users,

I am a relatively new user to this wonderful software. I have been using this software with the python wrapper. However, the compilation process for python wrapper is not very intuitive. When you call the make file with the option ‘install-python’, it runs the install.py script by using the python keyword (which I believe in general calls python 2.7). Nowadays, I believe most of the computers have python 2.7 and python 3.7 together. Since most of the python functionality is being supported in python 3.7, it makes more sense to me to build the lammps python wrapper for python 3.7. However, standard lammps make file does not use python 3 as default. If there was an option to choose python 2 or python 3 in the make command, that would be really helpful, otherwise you either need to run install.py script manually with python 3 or change the make file by yourself.

There is a way to set your python version. If you build LAMMPS using CMake, using -D PYTHON_EXECUTABLE=python3 (or whatever your preferred python interpreter is called, should do the trick). …and if you use the conventional build system, using: make PYTHON=python3 install-python should do the same. if you also want to use the LAMMPS PYTHON package, then you also need to copy lib/python/Makefile.lammps.python3 over lib/python/Makefile.lammps.

Axel.