pyqt5 python pyinstaller 踩坑记

1、pyinstaller生成EXE文件时产生的错误 RecursionError: maximum recursion depth exceeded

python默认的递归深度是很有限的(默认是1000),因此当递归深度超过999的样子,就会引发这样的一个异常。
解决方法:
在xxx.spec文件顶部加入代码:
# -*- mode: python -*-
import sys
sys.setrecursionlimit(5000)
用如下命令行继续打包:(其中xxx是要打包的文件名)
1 pyinstaller xxx.spec

 2、使用国内镜像pip安装

目前国内比较好用的pypi源有:

http://mirrors.aliyun.com/pypi/simple/          阿里云

http://pypi.douban.com/simple/                     豆瓣

https://pypi.mirrors.ustc.edu.cn/simple/         中国科技大学

http://pypi.mirrors.opencas.cn/simple/           中科院

https://pypi.tuna.tsinghua.edu.cn/simple/       清华大学

使用国内pypi源安装(以豆瓣为例)

pip install -i http://pypi.douban.com/simple/ pyqt5
pip install -i http://pypi.douban.com/simple/ pyqt5-tools

 

 3、pip install pyqt5-tools

版本pyqt5=5.15.4的designer.exe文件在qt5_applications\Qt\bin中

 

4、将 pip 的镜像源修改为清华大学的镜像源,可以运行以下命令:pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple

 

 

 

 
posted @ 2019-10-23 15:51  云中虾  阅读(405)  评论(0编辑  收藏  举报