Python: pyinstaller

https://pyinstaller.org/en/stable/
https://github.com/pyinstaller/pyinstaller/issues/4947
这个可以帮助开发着生成一个exe可执行文件。当然这个可执行文件依赖于:python39.dll。在打包的时候需要将这个dll文件一块带着。
如果没有dll,会有错误:
C:\Users\mzhan017\dist>a.exe
Error loading Python DLL ‘C:\Users\mzhan017\dist\python39.dll’.

pip install -U pyinstaller
默认安装路径
WARNING: The scripts pyi-archive_viewer.exe, pyi-bindepend.exe, pyi-grab_version.exe, pyi-makespec.exe, pyi-set_version.exe and pyinstaller.exe are installed in ‘C:\Users\mzhan017\AppData\Roaming\Python\Python39\Scripts’ which is not on PATH. Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.

pyinstaller your_program.py

猜你喜欢

转载自blog.csdn.net/qq_36428903/article/details/130980268
今日推荐