exe error with cx_freeze

后端 未结 3 1919
栀梦
栀梦 2020-12-17 01:51

Hey am relatively new to compiling python scripts to exe. Im using cx_freeze to compile my scripts and once its built i run the exe and it gives me this error. Have google a

相关标签:
3条回答
  • 2020-12-17 02:07

    cx_freeze will barf if the runtime working directory is not the directory that the executable is in.

    Is re the first import you do? What happens when you do them in a different order?

    0 讨论(0)
  • 2020-12-17 02:29

    Try to change

    includes = []
    

    to

    includes = ["re"]
    

    That worked for me

    0 讨论(0)
  • 2020-12-17 02:32

    Meeting this same problem putting re in includes didn't work for me. It produced a cx_Freeze.freezer.ConfigError when rebuilding the .py file.

    import sys
    from cx_Freeze import setup, Executable
    
    build_exe_options = {'include_files': ['re']}
    
    setup(  name = "Foreground Window Montior",
            version = "0.1",
            description = "Query the foreground window.",
            options = {'build_exe': build_exe_options},
            executables = [Executable("actWin_Query.py")])
    

    If I put re in packages rather than in include_files it did not produce this compile error.

    import sys
    from cx_Freeze import setup, Executable
    
    build_exe_options = {"packages": ["re"]}
    
    setup(  name = "Foreground Window Montior",
            version = "0.1",
            description = "Query the foreground window.",
            options = {'build_exe': build_exe_options},
            executables = [Executable("actWin_Query.py")])
    
    0 讨论(0)
提交回复
热议问题