首先,打开anaconda的Anaconda Prompt,激活对应的环境。
安装PyQt5
pip install PyQt5 -i https://pypi.douban.com/simple
安装PyQt工具:
pip install PyQt5-tools -i https://pypi.douban.com/simple
在安装工具的时候出现了以下问题:
Could not find a version that satisfies the requirement pyqt5==5.15.4 (from PyQt5-tools) (from versions: 5.6, 5.7, 5.7.1, 5.8, 5.8.1.1, 5.8.2, 5.9, 5.9.1, 5.9.2, 5.10, 5.10.1, 5.11.2, 5.11.3, 5.12, 5.12.1, 5.12.2, 5.12.3, 5.13.0, 5.13.1, 5.13.2, 5.14.0, 5.14.1, 5.14.2, 5.15.0, 5.15.1, 5.15.2)
No matching distribution found for pyqt5==5.15.4 (from PyQt5-tools)
原因是:创建的环境python是3.5的,pip 版本低,升级一下pip版本:python -m pip install --upgrade pip
之后会在anaconda安装路径下找到安装的pyqt5和pyqt5-tools,参考路径:D:\anacconda\Lib\site-packages