Python生成免安装exe
1.即使 pip show pyinstaller
显示已安装,有时可能会出现安装不完整的情况。可以尝试重新安装 pyinstaller
:
卸载:pip uninstall pyinstaller
安装:pip install pyinstaller
2.确保python安装路径(一般是D:\Program Files\python\Scripts,根据实际情况来)下有pyinstaller.exe
2.运行pyinstaller main.py,单个py文件,直接就能生成可免安装运行的exe和main.spec,如果是一个项目,py文件很多,执行pyinstaller main.spec
main.py中可能会隐藏调用的函数,需要在main.spec中说明
hiddenimports=['config','data_processor_nor','data_processor_mix','evaluate','excel_exporter','file_handler','folder_selector','selection_mode','SpecSelector'],