Python3.6 中的pyinstaller安装和使用教程

(编辑:jimmy 日期: 2025/3/1 浏览:2)

一、安装pyinstaller

先安装anacode,再去安装python。会有很多自带的lib库,可以省去很多麻烦。

1、用国外库安装

pip install pyinstalller

由于国外网络的限制,经常会报以下错误:

ERROR: Could not find a version that satisfies the requirement pyinstalller (from versions: none)
ERROR: No matching distribution found for pyinstalller

可以通过翻墙解决这一问题

2、用国内库安装

这里使用的是豆瓣的镜像进行安装

pip3 install pyinstaller -i http://pypi.douban.com/simple/ --trusted-host pypi.douban.com
Looking in indexes: http://pypi.douban.com/simple/

如果出现以下问题:

Python3.6 中的pyinstaller安装和使用教程

这里主要是是‘enum'参数问题:

 AttributeError: module 'enum' has no attribute 'IntFlag'

通过百度得知,是由于python版本的升级,导致了‘enum'出现兼容性问题,只要卸载‘enum'库就好了。

pip uninstall enum34

输出:

Found existing installation: enum34 1.1.6
Uninstalling enum34-1.1.6:
  Would remove:
    c:\programdata\anaconda3\lib\site-packages\enum34-1.1.6.dist-info\*
    c:\programdata\anaconda3\lib\site-packages\enum\*
Proceed (y/n)"text-align: center">Python3.6 中的pyinstaller安装和使用教程

二、使用pyinstaller

1、pyinstaller常用选项
2、生成exe

pyinstaller -Fw main.py ui.py

最终生成main.exe

总结

一句话新闻
微软与英特尔等合作伙伴联合定义“AI PC”:键盘需配有Copilot物理按键
几个月来,英特尔、微软、AMD和其它厂商都在共同推动“AI PC”的想法,朝着更多的AI功能迈进。在近日,英特尔在台北举行的开发者活动中,也宣布了关于AI PC加速计划、新的PC开发者计划和独立硬件供应商计划。
在此次发布会上,英特尔还发布了全新的全新的酷睿Ultra Meteor Lake NUC开发套件,以及联合微软等合作伙伴联合定义“AI PC”的定义标准。