RuntimeError: Cannot find the MXNet library

↘锁芯ラ 提交于 2019-12-11 05:57:36

问题


I want to create executable for my code where i'm using mxnet with pyinstaller.

I got this error

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

Added libmxnet.so though spec file but gave me PyInstallerImportError

Uninstalled mxnet though pip and copied python3.5/dist-packages/mxnet to my project same problem facing.

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.

Now what is dynlib/dll? How to resolve this error?

Thanks


回答1:


MXNet needs external binaries to be fed when you freeze it. You can use add-data flag to add libmxnet files to your executable:

pyinstaller -F --add-data="<python_path>/lib/python3.7/site-packages/mxnet/*.so*:./mxnet" script.py 


来源:https://stackoverflow.com/questions/57111738/runtimeerror-cannot-find-the-mxnet-library

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!