pyinstaller官方文档
虽然是英文,但能看就能少走很多弯路,像使用-F打包,遇到fileNotFoundError之类的问题,都能知其然,知其所以然地解决。
以下是摘录的一段打包单文件的工作原理
The bootloader is the heart of the one-file bundle also. When started it creates a temporary folder in the appropriate temp-folder location for this OS. The folder is named _MEIxxxxxx, where xxxxxx is a random number.
The one executable file contains an embedded archive of all the Python modules used by your script, as well as compressed copies of any non-Python support files (e.g. .so files). The bootloader uncompresses the support files and writes copies into the the temporary folder. This can take a little time. That is why a one-file app is a little slower to start than a one-folder app.
After creating the temporary folder, the bo
pyinstaller打包exe运行问题及解决方案

本文详细记录了在使用pyinstaller打包Python程序为exe过程中遇到的问题,包括控制台额外打开、运行闪退、找不到依赖文件和跨环境运行失败等,并提供了相应的解决方法,涉及模块安装、依赖文件放置以及代码修改等步骤。
最低0.47元/天 解锁文章
4290





