PyInstalle 打包

本文详细介绍如何下载并安装PyInstaller 4.3版本,包括离线安装及在线安装的方法,并提供了如何使用PyInstaller将Python脚本打包成单个可执行文件的具体步骤。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

 下載並安裝pyinstaller-4.3 

下載後解壓,在對應的目錄下執行install

pip3 install PyInstaller

 在線安裝

pip install -U https://github.com/pyinstaller/pyinstaller

单文件打包

pyinstaller -F main.py

生成spec文件

pyi-makespec -w main.py

通过spec文件打包

pyinstaller main.spec

升級pip

You should consider upgrading via the 'd:\python\python.exe -m pip install --upgrade pip' command.

python.exe -m pip install --upgrade pip

 Installing collected packages: pip
  Attempting uninstall: pip
    Found existing installation: pip 20.3.3
    Uninstalling pip-20.3.3:
      Successfully uninstalled pip-20.3.3
Successfully installed pip-21.1.3

–noconsole

–noconsole' not found

去掉–noconsole

-F $FileNameWithoutExtension$.py –noconsole

-F $FileNameWithoutExtension$.py

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值