我已经安装了ArrayFire,并试图让它在Canopy中运行。我跟着these instructions并输入了
export DYLD_LIBRARY_PATH=/usr/local/lib:$DYLD_LIBRARY_PATH
在Canopy终端中(使用'工具'菜单启动)。目录/ usr / local是ArrayFire库的目录:
ls /usr/local/lib/libaf*
/usr/local/lib/libaf.3.4.2.dylib
/usr/local/lib/libafcpu.3.4.2.dylib
/usr/local/lib/libafcuda.3.4.2.dylib
/usr/local/lib/libafopencl.3.4.2.dylib
/usr/local/lib/libaf.3.dylib
/usr/local/lib/libafcpu.3.dylib
/usr/local/lib/libafcuda.3.dylib
/usr/local/lib/libafopencl.3.dylib
/usr/local/lib/libaf.dylib
/usr/local/lib/libafcpu.dylib
/usr/local/lib/libafcuda.dylib
/usr/local/lib/libafopencl.dylib
在终端中pip安装arrayfire后,运行python并尝试
import arrayfire
不起作用:
RuntimeError: Could not load any ArrayFire libraries.
Please look at https://github.com/arrayfire/arrayfire-python/wiki for more information.
我尝试了来自Enthought支持的this post和this one中的说明,并创建了以下文件〜/ Library / LaunchAgents / environment.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>my.startup</string>
<key>ProgramArguments</key>
<array>
<string>sh</string>
<string>-c</string>
<string>
launchctl setenv DYLD_LIBRARY_PATH $DYLD_LIBRARY_PATH:/usr/local/lib
</string>
</array>
<key>RunAtLoad</key>
<true/>
</dict>
</plist>
没有成功。
在非Canopy python中执行相同操作正常,可以导入arrayfire。
有什么想法吗?