python2.7.5安装pyinstaller

centos7默认安装的python版本是2.7.5 比较老的版本,最近在安装pyinstall时,发现一些问题。

https://pypi.org/project/pyinstaller/3.6/#history

在该网站可以查看pyinstaller安装对应的python版本,目前python2.7.5最高安装pyinstaller  3.6

pip install pyinstaller==3.6

尽量安装高版本的pyinstaller 因为低版本的pyinstaller会有bug,比如在使用pyinstaller 3.0时。如果用户时root则可能会报错:No handlers could be found for logger "PyInstaller.utils.misc"

另外需要注意的一点时,如果开发和打包的python环境不同。也会有问题,比如,开发环境python版本是3,而打包环境python版本是2。那么这种情况下也有可能打包失败。可能的错误是语法错误。比如 python3的方法入参可以添加类型。而在python2打包时,会提示语法错误

猜你喜欢

转载自blog.csdn.net/kanyun123/article/details/117280219
今日推荐