0
我正在使用ctypes加載我的庫。代碼是一樣的東西如何使用python腳本在mac上導出DYLD_LIBRARY_PATH
currPath = os.getcwd()
libPath = os.path.join(currPath, platform)
print libPath
if(platform == 'win32'):
os.environ['PATH'] = os.environ['PATH'] + r';' + libPath
if(platform == 'darwin'):
os.environ['DYLD_LIBRARY_PATH'] = libPath {/Users/labuser/Desktop/lib}
print os.environ['DYLD_LIBRARY_PATH']
但是當我嘗試加載我的圖書館,它沒有找到庫路徑。
什麼是可能的解決方案。在啓動python腳本之前在終端上,我輸出DYLD_LIBRARY_PATH = PATH,那麼我的python腳本就可以正常工作。
你見過這個問題/答案:http://superuser.com/questions/282450/where-do-i-set-dyld-library-path-on-mac-os-x-and-is-it -一個好主意 ? – summea 2012-02-22 06:38:47