python文件打包为.exe可执行文件

系统 1163 0

一 点睛

Python项目打包需要安装PyInstaller模块。

python文件打包为.exe可执行文件_第1张图片

二 打包

1 CMD命令进入命令行

2 在命令行执行如下语句:

            
              pyinstaller -F E:\Python\studentsystem\studentsystem.py
            
          

其中-F 表示只生成一个扩展名为.exe的可执行文件。

执行结果如下:

            
              (venv) E:\Python\studentsystem>pyinstaller -F E:\Python\studentsystem\studentsystem.py
354 INFO: PyInstaller: 3.4
354 INFO: Python: 3.6.7
355 INFO: Platform: Windows-10-10.0.17134-SP0
356 INFO: wrote E:\Python\studentsystem\studentsystem.spec
366 INFO: UPX is not available.
370 INFO: Extending PYTHONPATH with paths
['E:\\Python\\studentsystem', 'E:\\Python\\studentsystem']
371 INFO: checking Analysis
371 INFO: Building Analysis because Analysis-00.toc is non existent
371 INFO: Initializing module dependency graph...
374 INFO: Initializing module graph hooks...
376 INFO: Analyzing base_library.zip ...
3833 INFO: running Analysis Analysis-00.toc
3894 INFO: Adding Microsoft.Windows.Common-Controls to dependent assemblies of final executable
  required by E:\Python\studentsystem\venv\Scripts\python.exe
4603 INFO: Caching module hooks...
4610 INFO: Analyzing E:\Python\studentsystem\studentsystem.py
4650 INFO: Loading module hooks...
4650 INFO: Loading module hook "hook-encodings.py"...
4794 INFO: Loading module hook "hook-pydoc.py"...
4797 INFO: Loading module hook "hook-xml.py"...
5039 INFO: Looking for ctypes DLLs
5039 INFO: Analyzing run-time hooks ...
5043 INFO: Looking for dynamic libraries
5260 INFO: Looking for eggs
5260 INFO: Using Python library E:\Python\studentsystem\venv\Scripts\python36.dll
5261 INFO: Found binding redirects:
[]
5265 INFO: Warnings written to E:\Python\studentsystem\build\studentsystem\warn-studentsystem.txt
5298 INFO: Graph cross-reference written to E:\Python\studentsystem\build\studentsystem\xref-studentsystem.html
5317 INFO: checking PYZ
5318 INFO: Building PYZ because PYZ-00.toc is non existent
5318 INFO: Building PYZ (ZlibArchive) E:\Python\studentsystem\build\studentsystem\PYZ-00.pyz
5718 INFO: Building PYZ (ZlibArchive) E:\Python\studentsystem\build\studentsystem\PYZ-00.pyz completed successfully.
5722 INFO: checking PKG
5723 INFO: Building PKG because PKG-00.toc is non existent
5723 INFO: Building PKG (CArchive) PKG-00.pkg
7957 INFO: Building PKG (CArchive) PKG-00.pkg completed successfully.
7965 INFO: Bootloader E:\Python\studentsystem\venv\lib\site-packages\PyInstaller\bootloader\Windows-64bit\run.exe
7967 INFO: checking EXE
7967 INFO: Building EXE because EXE-00.toc is non existent
7968 INFO: Building EXE from EXE-00.toc
7969 INFO: Appending archive to EXE E:\Python\studentsystem\dist\studentsystem.exe
8000 INFO: Building EXE from EXE-00.toc completed successfully.
            
          

三 验证

python文件打包为.exe可执行文件_第2张图片

 

 


更多文章、技术交流、商务合作、联系博主

微信扫码或搜索:z360901061

微信扫一扫加我为好友

QQ号联系: 360901061

您的支持是博主写作最大的动力,如果您喜欢我的文章,感觉我的文章对您有帮助,请用微信扫描下面二维码支持博主2元、5元、10元、20元等您想捐的金额吧,狠狠点击下面给点支持吧,站长非常感激您!手机微信长按不能支付解决办法:请将微信支付二维码保存到相册,切换到微信,然后点击微信右上角扫一扫功能,选择支付二维码完成支付。

【本文对您有帮助就好】

您的支持是博主写作最大的动力,如果您喜欢我的文章,感觉我的文章对您有帮助,请用微信扫描上面二维码支持博主2元、5元、10元、自定义金额等您想捐的金额吧,站长会非常 感谢您的哦!!!

发表我的评论
最新评论 总共0条评论