anaconda下 base环境自带pyqt 但作为初学者使用起来不好用
于是 我自己创了一个环境专门去搞pyqt
接下来是如何使用pycharm通过anaconda来配置使用pyqt
默认已经安装anaconda 和pycharm
首先打开 anaconda prompt
输入
上面的的代码块是安装过程
总结:
1>conda create -n GUIpyqt python=3.7
2>conda activate GUIpyqt
3>pip install sip
pip install PyQt5 -i https://pypi.douban.com/simple
pip install PyQt5-tools -i https://pypi.douban.com/simple
安装PyQt:
第一步创建环境;第二步打开创建的环境 ;第三步 安装 sip ,PyQt5, PyQt5-tools 扩展包
接下来在pycharm中导入安装好pyqt的环境GUIpyqt
![e9b0baa935bf21d4aa6c1ccafd85e7cb.png](https://img-blog.csdnimg.cn/img_convert/e9b0baa935bf21d4aa6c1ccafd85e7cb.png)
具体请点击 https://blog.csdn.net/weixin_41923961/article/details/86584683
接下来是配置 QTdesigner 和 pyuic
打开 settings 找到tools ——>external tools
![8ab2b6971ea233bafacf40d2da4d9ea8.png](https://img-blog.csdnimg.cn/img_convert/8ab2b6971ea233bafacf40d2da4d9ea8.png)
![c60a973e8be7e61778081bdd79541aa6.png](https://img-blog.csdnimg.cn/img_convert/c60a973e8be7e61778081bdd79541aa6.png)
name: QtDesigner
description: QtDesigner
program: D:Anaconda3envsGUIpyqtLibsite-packagespyqt5_toolsQtbindesigner.exe
working directory: D:Anaconda3envsGUIpyqtLibsite-packagespyqt5_toolsQtbin
![0448559027a4fbaedce727c2d7e55147.png](https://img-blog.csdnimg.cn/img_convert/0448559027a4fbaedce727c2d7e55147.png)
name: PyUic
description: PyUic
program: D:Anaconda3envsGUIpyqtScriptspyuic5.exe
arguments: $FileName$ -o $FileNameWithoutExtension$.py
working directory: $FileDir$
working directory: $FileDir$ 中一定在 $FileDir$ 前面无空格 !!!!!
狗则会出现:
![dc8e99c30228e2b79c2614a2bd7ed60c.png](https://img-blog.csdnimg.cn/img_convert/dc8e99c30228e2b79c2614a2bd7ed60c.png)
说明在“$FileDir$ ”前面有空格!!!!!!!!!!!!!!!!
在QtDesigner配置中会出现
Process finished with exit code -1073741515 (0xC0000135)
这时候你去找designer.exe文件
D:Anaconda3envsGUIpyqtLibsite-packagespyqt5_toolsQtbindesigner.exe
双击发现打不开
会提示你 由于缺少 vcruntime140_1.dll
vcruntime140_1.dll文件网址 https://www.jb51.net/dll/vcruntime140_1.dll.html
解压后将其放在 C:WindowsSystem32 中
就OK
![7d479800470736c2c0ba53758b6c90f1.png](https://img-blog.csdnimg.cn/img_convert/7d479800470736c2c0ba53758b6c90f1.png)