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

前端 未结 1 983
我在风中等你
我在风中等你 2021-01-28 08:29

I am using Debian 9, python 3.7.3 and cx_Freeze 6.0b1. I spent some time installing cx_Freeze on Windows 7 and Debian, I managed to compile the script on both platforms.

相关标签:
1条回答
  • 2021-01-28 09:03

    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.

    0 讨论(0)
提交回复
热议问题