安装Anaconda3
1、下载版本是Anaconda3-2020.11-Windows-x86_64.exe
https://mirrors.tuna.tsinghua.edu.cn/anaconda/archive/
默认安装,默认勾选,安装路径不能有空格,例如D:\ProgramData\Anaconda3
安装完,桌面-开始菜单,可以看到:
在【Environments】子菜单搜索“python”关键字,可以看到python的版本是3.8.5,已自动安装好。
2、新建虚拟环境
打开【开始】菜单的 Anaconda Prompt
查看已有环境,新安装的Anaconda3中只存在一个base环境
conda info -e 或者 conda env list
创建环境
conda create -n firecat python=3.8.5
激活新安装的环境
conda activate firecat
取消激活,并返回默认的base环境
conda deactivate
删除一个已有的环境
conda remove --name firecat --all
注:创建自己的环境firecat之后,会生成文件夹D:\ProgramData\Anaconda3\envs\firecat
3、修改pip的安装路径
查看默认安装路径的终端命令是 python -m site
USER_SITE: 'C:\\Users\\firecat\\AppData\\Roaming\\Python\\Python38\\site-packages' (exists)
USER_BASE: 'C:\\Users\\firecat\\AppData\\Roaming\\Python' (exists)
D:\ProgramData\Anaconda3\Lib\site.py,第87行
# Enable per user site-packages directory
# set it to False to disable the feature or True to force the feature
ENABLE_USER_SITE = None
# for distutils.commands.install
# These values are initialized by the getuserbase() and getusersitepackages()
# functions, through the main() function when Python starts.
USER_SITE = None
USER_BASE = None
修改为自定义,
# Enable per user site-packages directory
# set it to False to disable the feature or True to force the feature
ENABLE_USER_SITE = True
# for distutils.commands.install
# These values are initialized by the getuserbase() and getusersitepackages()
# functions, through the main() function when Python starts.
USER_SITE = "D:\\ProgramData\\Anaconda3\\envs\\firecat\\Lib\\site-packages"
USER_BASE = "D:\\ProgramData\\Anaconda3\\envs\\firecat\\Scripts"
安装PyQt5
1、方法1,默认安装源安装PyQt5
打开【开始】菜单的 Anaconda Prompt
激活自己的环境
conda activate firecat
查看
pip list
conda list
安装
pip install pyqt5 --user
pip install pyqt5-tools --user
pip install PyQt5-stubs --user
pip install PyQtChart --user
pip install pyqtwebengine --user
pip install qscintilla --user
卸载
pip uninstall pyqt5 -y
pip uninstall pyqt5-tools -y
pip uninstall PyQt5-stubs -y
pip uninstall qscintilla -y
pip uninstall pyqtwebengine -y
pip uninstall PyQtChart -y
pip uninstall PyQt5-sip -y
退出自己的环境
conda deactivate
2、方法2,pip换源安装PyQt
打开【开始】菜单的 Anaconda Prompt
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple pyqt5 --user
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple pyqt5-tools --user
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple qscintilla --user
或者直接全局更为镜像源:【推荐】
windows下,直接在user目录中创建一个pip目录,如:C:\Users\firecat\pip,新建文件pip.ini,内容如下
[global]
index-url = https://pypi.tuna.tsinghua.edu.cn/simple

