美文网首页胖达君的超级工具
【Python 打包exe 】【python虚拟环境】【 pyi

【Python 打包exe 】【python虚拟环境】【 pyi

作者: aladen | 来源:发表于2021-12-29 19:40 被阅读0次

(1)如果不建立虚拟环境的话,打出的exe文件非常大,所以需要建立虚拟环境

使用的是anaconda3 内置python的版本为python3.8

建立虚拟环境的步骤如下:


查看虚拟环境:conda info --envs

conda create -n auto python==3.8  #创建虚拟环境 auto为我自己起的名字

建立后的虚拟环境在anaconda安装目录的envs下面:

conda activate auto  #激活虚拟环境

conda deactivate  #退出虚拟环境

conda remove -n aotu--all  # 删除虚拟环境


在虚拟环境中安装需要用到的包

pip install -i https://pypi.tuna.tsinghua.edu.cn/simple pyinstaller

(2) 打包

切换到存放代码和ico图片的地方:使用这个命令打包

Pyinstaller -F -i a.ico a.py

打包后:

参考文章:

(1)别再问我怎么Python打包成exe了

(2)文件夹太乱?Python小程序瞬间帮你整理到位

相关文章

网友评论

    本文标题:【Python 打包exe 】【python虚拟环境】【 pyi

    本文链接:https://www.haomeiwen.com/subject/zvqbqrtx.html