Skip to content Skip to sidebar Skip to footer

Python Setup.py Build Ctypes.cdll: Cannot Open Shared Object File: No Such File Or Directory

I have implemented a ctypes wrapper called api.c, and I have the structure: lib/api.c foo.py setup.py Compiling api.c manually and calling ctypes.CDLL(path+'lib/api.so') inside fo

Solution 1:

I found that when adding the argument py_modules=['foo'] to setup, python setup.py install installed it properly in the site-packages directory. Thus

setup(name='foo',
      py_modules=['foo'],
      ext_modules=[Extension('lib.api', ['lib/api.c'])]
     )

Post a Comment for "Python Setup.py Build Ctypes.cdll: Cannot Open Shared Object File: No Such File Or Directory"