我想为我的代码创建可执行文件,其中我使用mxnet和pyinstaller。
我得到了这个错误
File "mxnet/libinfo.py", line 74, in find_lib_path
RuntimeError: Cannot find the MXNet library.
List of candidates:
/home/rit/test/exe/dist/test/libmxnet.so
/home/rit/test/exe/dist/test/libmxnet.so
/home/rit/test/exe/dist/test/mxnet/libmxnet.so
/home/rit/test/exe/dist/test/mxnet/../../lib/libmxnet.so
/home/rit/test/exe/dist/test/mxnet/../../build/libmxnet.so
添加了libmxnet.so虽然规范文件,但给我PyInstallerImportError
通过pip卸载mxnet并将python3.5/dist-packages/mxnet复制到我的项目中,面临同样的问题。
File "PyInstaller/loader/pyiboot01_bootstrap.py", line 151, in __init__
__main__.PyInstallerImportError: Failed to load dynlib/dll '/home/rit/test/exe/dist/test/libmxnet.so'. Most probably this dynlib/dll was not found when the application was frozen.
什么是dynlib/dll?如何解决这个错误?
谢谢
2条答案
按热度按时间pengsaosao1#
MXNet在冻结时需要外部二进制文件。您可以使用
add-data
标志将libmxnet文件添加到可执行文件中:fwzugrvs2#
如果你用的是linux,可以像我一样运行。
我的find结果是这样的:
所以我会做: