Python runtime_library_dirs doesn't work on Mac

前端 未结 2 1909
梦如初夏
梦如初夏 2020-12-29 15:30

I have a Python extension module that needs to link against some dynamic libraries at runtime, so I need to tell it where to look for them. I\'m doing this by specifying ru

2条回答
  •  伪装坚强ぢ
    2020-12-29 15:59

    You can tell what libraries an extension links against with

    otool -L pyext.so
    

    I had a problem where an extension was linking to the wrong version of a library on my system. In that case I used install_name_tool to change the path to the library directly. For example,

    install_name_tool -change /wrong/libfoo.dylib /right/libfoo.dylib pyext.so
    

提交回复
热议问题