一、配置虚拟环境
#格式如下
conda create -n 虚拟环境名字 python=版本 #创建虚拟环境,开始新项目时执行一次
conda activate 虚拟环境名字 #进入虚拟环境,每次打开终端都需要执行
conda deactivate #退出虚拟环境,一般很少使用
conda remove -n 虚拟环境名字 --all #删除虚拟环境,一般很少使用
#示例
conda create -n test python=3.8
conda activate test
conda deactivate
conda remove -n test --all
二、安装pyqt5
在新创建的虚拟环境中安装PyQt5
pip install PyQt5 -i https://pypi.tuna.tsinghua.edu.cn/simple/
pip install PyQt5-tools -i https://pypi.tuna.tsinghua.edu.cn/simple/
查看是否安装成功
三、pycharm创建新的项目文件
四、配置pyqt5开发环境
而后进行安装, 国内阿里源速度很快,可以临时切换到阿里源,输入如下命令:
pip install pyqt5-tools -i https://mirrors.aliyun.com/pypi/simple/
五、PyUIC工具(用于将.ui文件转换为.py文件)
$FileDir$
六、借鉴笔记(成功版)
借鉴:Pycharm配置pyqt5_helloworld*的博客-CSDN博客_pycharm pyqt5