美文网首页Shell-Python
Python3.7使用PyInstaller在Mac和Win10

Python3.7使用PyInstaller在Mac和Win10

作者: 开子的私家地 | 来源:发表于2020-02-12 22:05 被阅读0次

原文:https://blog.csdn.net/Blaststone/article/details/89350496

一、安装

终端安装: pip install pyinstaller
(注意python版本)
PyCharm安装:files->settings->Project Interpreter 右侧边栏点击+号,搜索安装pyinstaller。
注意:
1.最好不要使用Anaconda3的环境,因为默认的库太多了,后期打包会疯狂报错。
2.用多少库import多少库,不然你的可执行文件会非常大
二、打包

在终端cd到你的py文件所在文件夹,然后输入:

pyinstaller -F -w qt.py

三、运行

Win10下:当前文件夹中的dist文件夹里面生成的同名exe文件

Mac下:dist文件夹里面生成的同名app文件

亲测:
Mac下OK

相关文章

网友评论

    本文标题:Python3.7使用PyInstaller在Mac和Win10

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