[随笔]python之生成exe

方式写在最后;

 

在将exe打包成文件时,使用pip install pyinstaller,遇到以下问题:

在pip install pyinstaller后

提示我:

Installing build dependencies ... done
Getting requirements to build wheel ... error

似乎是build安装的依赖失败

查资料,说要将pip降级为18.1,遂:

查了当前pip的版本:

>>>pip --version

得到19.0.1

遂:

>>>pip install pip==18.1

但发生了一些错误。

遂放弃此方式。

 

 

【写在最后】

在 http://www.pyinstaller.org/downloads.html 上下载pyinstaller到python下的scripts目录里,解压。

win+r ——>进入加压后的pyinstaller目录,注意:此目录下有setup.py。

然后输入:python setup.py install

得到:Finished processing dependencies for PyInstaller==3.5

 

测试一下能否打包了:

win+r 进入要打包的py文件目录下

然后,输入pyinstaller -F  你要打包的文件名字.py  ,再回车

最后得到一段文字“xxxxx,completed successfully.”

 

形成的 exe文件,在py文件目录下的dist文件夹里

 

 

 

 

 

 

posted @ 2019-11-13 16:43  舒汐桐  阅读(382)  评论(0编辑  收藏  举报