Hello! I am trying to install LAMMPS on a Mac using the macOS terminal. I followed the instructions on lammps.org and built the program using the Cmake commands on 3.1. Build LAMMPS with CMake — LAMMPS documentation . After that I followed the PyLammps quick start tutorial (8.6.3. PyLammps Tutorial — LAMMPS documentation) to build the shared folder and open the PyLammps Jupyter notebooks. However, when I run one of the jupyter notebooks, I get an import error saying there is ‘no module named Lammps’.
The errors seem to be related to the following:
- sys.path is missing some paths
- ld is missing some paths
- run command seems to fail and possible can’t find the path to the lmp command
I have been able to import LAMMPS by appending a path to sys.path, but that leads to further errors running the files, all seem related to the file locations. I have tried adding the export commands (from 2.2. Installation — LAMMPS documentation):
Is there any command in the installation I may have missed out, or any reason why I am having so many path errors? Thank you!!!
(EDIT) the commands used for installation are as follows:
Dowloaded from lammps.org
tar -xzvf lammps-stable.tar.gz
#go to main LAMMPS directory
cmake --build .
#first return to main LAMMPS directory
cmake …/cmake -DPKG_MOLECULE=yes -DLAMMPS_EXCEPTIONS=yes -DBUILD_LIB=yes -DBUILD_SHARED_LIBS=yes
cmake . -DPYTHON_EXECUTABLE=$(which python)
(testing) make install-python
(testing) pip install matplotlib jupyter mpi4py
Python 3.10.2 (main, Feb 2 2022, 06:19:27) [Clang 13.0.0 (clang-1300.0.29.3)] on darwin
Type “help”, “copyright”, “credits” or “license” for more information.
(pyenv) import lammps
Traceback (most recent call last):
File “”, line 1, in
ModuleNotFoundError: No module named ‘lammps’