1.打包單個python文件,進入存放XXX.py的目錄,打開命令窗口,直接使用pyinstaller -F XXX.py
2.打包時取出CMD黑框,pyinstaller -F XXX.py --noconsole
3.打包加入exe圖標,pyinstaller -F -i picturename.ico -w XXX.py
4.打包多個目錄(多個文件),
pyinstaller -F -i index.ico -c index.py -p F:\python\auto_tools\auto_v3check\toolpage --hidden-import v3check.py --hidden-import V3CRCTool-0.0.1-SNAPSHOT.jar
5.打包去除控制台,pyinstaller -w xxx.py
6.打包方便查看報錯,可看到控制台,pyinstaller -c xxx.py
7.打包運行出現"Failed to execute script xxx.exe"錯誤
numpy.core.multiarray failed to import
解決方式:
使用 文本編輯器打開修改xxx.spec
2.打包時取出CMD黑框,pyinstaller -F XXX.py --noconsole
3.打包加入exe圖標,pyinstaller -F -i picturename.ico -w XXX.py
4.打包多個目錄(多個文件),
pyinstaller -F -i index.ico -c index.py -p F:\python\auto_tools\auto_v3check\toolpage --hidden-import v3check.py --hidden-import V3CRCTool-0.0.1-SNAPSHOT.jar
5.打包去除控制台,pyinstaller -w xxx.py
6.打包方便查看報錯,可看到控制台,pyinstaller -c xxx.py
7.打包運行出現"Failed to execute script xxx.exe"錯誤
numpy.core.multiarray failed to import
解決方式:
使用 文本編輯器打開修改xxx.spec


然后在運行pyinstaller xxx.spec(以此spec文件打包python)