How to fix numpy dependencies path on a python 3.7.3 script on Linux frozen with cx_Freeze 6.0b1?

妖精的绣舞 提交于 2019-12-02 11:56:18

Try to manually copy all the lib*.so.* files into the lib subdirectory of the frozen application before sharing. Does this solve your problem? If yes, you could automatize this step using shutil.copy2 at the end of your setup.py script for example.

Regarding your comment:

The app is still looking for the files in the absolute path, and I don't understand why

I guess you refer to the paths appearing in the tracebacks. These are filenames attached to code objects which presumably do not get actualized when the frozen application is moved. You can let cx_Freeze replace these absolute paths through relative ones by adding an entry

'replace_paths': [("*", "")]

to the build_exe option dictionary in the setup.py script. See issue #247 on the cx_Freeze repository and the links therein.

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