pip install pyinstaller #安装打包模块
#使用:
pyinstaller -F -w+文件名位置# 注意如果代码里面要input 就不要用W
pyinstaller -F C:\01.py #比如这样就可以了
#注意打包后的文件所在的位置在运行信息里面 也可以自己指定比如麻烦看一下就行了
#倒数第二行就是打包好的EXE 文件所在位置
C:\Users\Administrator>pyinstaller -F C:\01.py
77 INFO: PyInstaller: 3.5
77 INFO: Python: 3.7.3
78 INFO: Platform: Windows-10-10.0.17763-SP0
79 INFO: wrote C:\Users\Administrator\01.spec
83 INFO: UPX is not available.
84 INFO: Extending PYTHONPATH with paths
['C:\\', 'C:\\Users\\Administrator']
84 INFO: checking Analysis
86 INFO: Building because C:\01.py changed
86 INFO: Initializing module dependency graph...
91 INFO: Initializing module graph hooks...
93 INFO: Analyzing base_library.zip ...
2738 INFO: running Analysis Analysis-00.toc
2741 INFO: Adding Microsoft.Windows.Common-Controls to dependent assemblies of final executable
required by c:\users\administrator\appdata\local\programs\python\python37\python.exe
3055 INFO: Caching module hooks...
3059 INFO: Analyzing C:\01.py
3062 INFO: Loading module hooks...
3062 INFO: Loading module hook "hook-encodings.py"...
3201 INFO: Loading module hook "hook-pydoc.py"...
3202 INFO: Loading module hook "hook-xml.py"...
3423 INFO: Looking for ctypes DLLs
3423 INFO: Analyzing run-time hooks ...
3428 INFO: Looking for dynamic libraries
3545 INFO: Looking for eggs
3545 INFO: Using Python library c:\users\administrator\appdata\local\programs\python\python37\python37.dll
3545 INFO: Found binding redirects:
[]
3551 INFO: Warnings written to C:\Users\Administrator\build\01\warn-01.txt
3585 INFO: Graph cross-reference written to C:\Users\Administrator\build\01\xref-01.html
3594 INFO: checking PYZ
3596 INFO: Building because toc changed
3596 INFO: Building PYZ (ZlibArchive) C:\Users\Administrator\build\01\PYZ-00.pyz
3914 INFO: Building PYZ (ZlibArchive) C:\Users\Administrator\build\01\PYZ-00.pyz completed successfully.
3923 INFO: checking PKG
3924 INFO: Building because toc changed
3925 INFO: Building PKG (CArchive) PKG-00.pkg
5306 INFO: Building PKG (CArchive) PKG-00.pkg completed successfully.
5309 INFO: Bootloader c:\users\administrator\appdata\local\programs\python\python37\lib\site-packages\PyInstaller\bootloader\Windows-64bit\run.exe
5310 INFO: checking EXE
5312 INFO: Building because toc changed
5312 INFO: Building EXE from EXE-00.toc
5314 INFO: Appending archive to EXE C:\Users\Administrator\dist\01.exe
5319 INFO: Building EXE from EXE-00.toc completed successfully.
使用pyinstaller打包Python程序EXE
最新推荐文章于 2022-02-23 11:11:54 发布