cx_freeze转换为exe后,程序无法运行

时间:2020-10-14 23:34:37

标签: python cx-freeze

我的代码在Pycharm中运行良好。但是当它转换为exe时,程序立即关闭,我尝试将其打开。

下面是我在setup.py中的代码

from cx_Freeze import setup, Executable

packages = [
'pygame',
'pyaudio',
'wave',
'time',
'scipy.io',
'python_speech_features',
'os',
'pickle', 
'ModA', # ModA and ModB is other 2 py I wrote for the program
'ModB'
]
includefiles = ['file.pkl', '.\\audio\\']  # i imported a pickle file and a folder with some audio files inside
includes = []
excludes = []


setup(
    name="Project",
    version="0.1",
    options={'build_exe': {'excludes': excludes, 'packages': packages, 'include_files': includefiles}},
    executables=[Executable(script="Main.py", base=None, icon='confiture.ico', shortcutDir='Desktop')]
)

我将此代码用于另一个程序,它工作正常。请帮助我,我做错了什么。这将是一个很大的帮助。非常感谢〜

0 个答案:

没有答案