打包普通的Python程序

python文件打包的过程

Microsoft Windows [版本 6.1.7601]
版权所有 (c) 2009 Microsoft Corporation。保留所有权利。

(pytorch) C:\Users\Administrator\Desktop\Code\Python_Code\19> pyinstaller -F Demo.py
1275 INFO: PyInstaller: 4.10
1276 INFO: Python: 3.6.13 (conda)
1276 INFO: Platform: Windows-7-6.1.7601-SP1
1277 INFO: wrote C:\Users\Administrator\Desktop\Code\Python_Code\19\Demo.spec
1279 INFO: UPX is not available.
1281 INFO: Extending PYTHONPATH with paths
['C:\\Users\\Administrator\\Desktop\\Code\\Python_Code\\19']
1615 INFO: checking Analysis
1628 INFO: Building because Analysis-00.toc is bad
1629 INFO: Initializing module dependency graph...
1631 INFO: Caching module graph hooks...
1644 INFO: Analyzing base_library.zip ...
4820 INFO: Caching module dependency graph...
4974 INFO: running Analysis Analysis-00.toc
4992 INFO: Adding Microsoft.Windows.Common-Controls to dependent assemblies of final executable
  required by D:\ANACONDA\envs\pytorch\python.exe
5185 INFO: Analyzing C:\Users\Administrator\Desktop\Code\Python_Code\19\Demo.py
5187 INFO: Processing module hooks...
5187 INFO: Loading module hook 'hook-difflib.py' from 'D:\\ANACONDA\\envs\\pytorch\\lib\\site-packages\\PyInstaller\\hooks'...
5188 INFO: Loading module hook 'hook-encodings.py' from 'D:\\ANACONDA\\envs\\pytorch\\lib\\site-packages\\PyInstaller\\hooks'...
5270 INFO: Loading module hook 'hook-heapq.py' from 'D:\\ANACONDA\\envs\\pytorch\\lib\\site-packages\\PyInstaller\\hooks'...
5271 INFO: Loading module hook 'hook-pickle.py' from 'D:\\ANACONDA\\envs\\pytorch\\lib\\site-packages\\PyInstaller\\hooks'...
5272 INFO: Loading module hook 'hook-xml.py' from 'D:\\ANACONDA\\envs\\pytorch\\lib\\site-packages\\PyInstaller\\hooks'...
5523 INFO: Looking for ctypes DLLs
5524 INFO: Analyzing run-time hooks ...
5526 INFO: Including run-time hook 'D:\\ANACONDA\\envs\\pytorch\\lib\\site-packages\\PyInstaller\\hooks\\rthooks\\pyi_rth_subprocess.py'
5527 INFO: Including run-time hook 'D:\\ANACONDA\\envs\\pytorch\\lib\\site-packages\\PyInstaller\\hooks\\rthooks\\pyi_rth_pkgutil.py'
5529 INFO: Including run-time hook 'D:\\ANACONDA\\envs\\pytorch\\lib\\site-packages\\PyInstaller\\hooks\\rthooks\\pyi_rth_inspect.py'
5533 INFO: Looking for dynamic libraries
5604 INFO: Looking for eggs
5604 INFO: Using Python library D:\ANACONDA\envs\pytorch\python36.dll
5604 INFO: Found binding redirects:
[]
5608 INFO: Warnings written to C:\Users\Administrator\Desktop\Code\Python_Code\19\build\Demo\warn-Demo.txt
5636 INFO: Graph cross-reference written to C:\Users\Administrator\Desktop\Code\Python_Code\19\build\Demo\xref-Demo.html
5649 INFO: checking PYZ
5652 INFO: Building because name changed
5652 INFO: Building PYZ (ZlibArchive) C:\Users\Administrator\Desktop\Code\Python_Code\19\build\Demo\PYZ-00.pyz
6027 INFO: Building PYZ (ZlibArchive) C:\Users\Administrator\Desktop\Code\Python_Code\19\build\Demo\PYZ-00.pyz completed successfully.
6033 INFO: checking PKG
6041 INFO: Building because PKG-00.toc is bad
6042 INFO: Building PKG (CArchive) Demo.pkg
7597 INFO: Building PKG (CArchive) Demo.pkg completed successfully.
7600 INFO: Bootloader D:\ANACONDA\envs\pytorch\lib\site-packages\PyInstaller\bootloader\Windows-64bit\run.exe
7600 INFO: checking EXE
7607 INFO: Rebuilding EXE-00.toc because Demo.exe missing
7608 INFO: Building EXE from EXE-00.toc
7608 INFO: Copying bootloader EXE to C:\Users\Administrator\Desktop\Code\Python_Code\19\dist\Demo.exe.notanexecutable
7612 INFO: Copying icon to EXE
7612 INFO: Copying icons from ['D:\\ANACONDA\\envs\\pytorch\\lib\\site-packages\\PyInstaller\\bootloader\\images\\icon-console.ico']
7613 INFO: Writing RT_GROUP_ICON 0 resource with 104 bytes
7613 INFO: Writing RT_ICON 1 resource with 3752 bytes
7613 INFO: Writing RT_ICON 2 resource with 2216 bytes
7613 INFO: Writing RT_ICON 3 resource with 1384 bytes
7613 INFO: Writing RT_ICON 4 resource with 37019 bytes
7613 INFO: Writing RT_ICON 5 resource with 9640 bytes
7614 INFO: Writing RT_ICON 6 resource with 4264 bytes
7614 INFO: Writing RT_ICON 7 resource with 1128 bytes
7616 INFO: Copying 0 resources to EXE
7616 INFO: Emedding manifest in EXE
7617 INFO: Updating manifest in C:\Users\Administrator\Desktop\Code\Python_Code\19\dist\Demo.exe.notanexecutable
7617 INFO: Updating resource type 24 name 1 language 0
7619 INFO: Appending PKG archive to EXE
9550 INFO: Building EXE from EXE-00.toc completed successfully.

(pytorch) C:\Users\Administrator\Desktop\Code\Python_Code\19>^A

我能得到的信息

根据你提供的输出信息,可以得出以下结论:

  1. PyInstaller版本:输出中显示使用的是PyInstaller 4.10版本。

  2. Python版本:输出中显示使用的是Python 3.6.13版本。

  3. 平台信息:输出中显示运行在Windows 7 SP1操作系统上。

  4. 构建过程:根据输出,PyInstaller首先生成了一个.spec文件,然后进行了分析和构建过程。在分析阶段,它检查了Python脚本和相关的依赖项。在构建阶段,它生成了可执行文件和其他必要的资源文件。

  5. 可执行文件:最后输出了构建完成的可执行文件的路径,它位于C:\Users\Administrator\Desktop\Code\Python_Code\19\dist目录下,文件名为Demo.exe.notanexecutable。注意,这个文件名是由于PyInstaller的保护机制导致的,应该是一个可执行文件。

根据输出,看起来构建过程已经成功完成。你可以在C:\Users\Administrator\Desktop\Code\Python_Code\19\dist目录中找到生成的可执行文件,尝试运行它来验证打包是否成功。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

王摇摆

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值