setting up python interface with cmake

I forgot to add info about the error.
When I go into python and type the following I get the error below

from lammps import lammps
Traceback (most recent call last):
File “”, line 1, in
File “/Users/daw/D_downloaded_software/D_LAMMPS/lammps-12Dec18/python/”, line 94, in init
if not name: self.lib = CDLL(“”,RTLD_GLOBAL)
File “/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ctypes/”, line 365, in init
self._handle = _dlopen(self._name, mode)
OSError: dlopen(, 10): image not found

I had defined these environment variables in .cshrc:

setenv DYLD_LIBRARY_PATH /usr/local/lib:/Users/daw/D_downloaded_software/D_LAMMPS/lammps-12Dec18/build_serial
setenv LD_LIBRARY_PATH /usr/local/lib:/Users/daw/D_downloaded_software/D_LAMMPS/lammps-12Dec18/build_serial
setenv PYTHONPATH /Users/daw/D_downloaded_software/D_LAMMPS/lammps-12Dec18/python

but did you build the shared library and installed the python module as required?


you may want to download the very latest LAMMPS patch version and build with CMake instead of the conventional build. there was some change contributed to help building/installing the shared library on MacOSX…