1、python2.7 没有安装 setuptools,所有先下载 setuptools 压缩包。解压后,打开cmd,把路径转到解压文件夹,执行 python setuptools install
2、安装 pip,通过 pip 安装 python-qt5 时,找不到资源。直接在 github 下载,网址:https://github.com/pyqt/python-qt5。
3、安装与第一步相同。
4、执行pyqt5生成的界面文件时,提示错误:
This application failed to start because it could not find or load the Qt platform plugin “windows” in “”.
5、参考这篇博客,配置一个环境变量:https://blog.csdn.net/qq_36523839/article/details/80495746。
变量名:QT_QPA_PLATFORM_PLUGIN_PATH
值:pyqt5 plugins 的路径
配置完之后,运行成功。