在重装系统后重装conda,然后换源后还是很慢,摸索了两天终于可以了,在csdn发个文章防止忘记
安装conda准备:关闭360安全卫士,取消主动防御系统
1.下载安装包
anaconda:
https://mirrors.bfsu.edu.cn/anaconda/Index of /anaconda/archive/ | 北京外国语大学开源软件镜像站 | BFSU Open Source Mirrorhttps://mirrors.bfsu.edu.cn/anaconda/
miniconda:以conda版本4.9.2,py版本3.9 为例
Index of /anaconda/miniconda/ | 北京外国语大学开源软件镜像站 | BFSU Open Source Mirror
2.安装conda
一直下一步,自由选择just me还是all user,选择了all user,注意不需要在这步添加path
3.添加path
添加用户变量和系统变量
文本:
C:\Miniconda3;C:\Miniconda3\Scripts;C:\Miniconda3\Library\bin;C:\Miniconda3\Library\usr\bin;C:\Miniconda3\Library\mingw-w64\bin;
拆分:
C:\Miniconda3
C:\Miniconda3\Scripts
C:\Miniconda3\Library\bin
C:\Miniconda3\Library\usr\bin
C:\Miniconda3\Library\mingw-w64\bin
另外miniconda的library下面是真的没有mingw-w64,但是添加就对了,不然pycharm无法识别
用户变量:
系统变量:
4.pip换源
运行pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple/
找到目录,在pip.ini中添加(应该说是将文件内容替换为)
[global]
timeout = 6000
index-url = http://pypi.tuna.tsinghua.edu.cn/simple/
trusted-host = pypi.tuna.tsinghua.edu.cn
因为目前找到的资料中第一行global输成gobal,并且全部都试图在C:\Users\16671\pip中新建pip.ini而不是C:\Users\16671\AppData\Roaming\pip导致换源未成功
5.conda换源
添加的为清华源
另外中科大源USTC Open Source Software Mirror已经寄了2022年12月19日,列表里已经没有anaconda了,清华源清华大学开源软件镜像站 | Tsinghua Open Source Mirror也寄了,点击清华源中的anaconda会跳转到北京外国语大学开源软件镜像站的anaconda 2022年12月19日,因此在此处直接添加北京外国语的镜像源
conda config --set show_channel_urls yes
conda config --add channels https://mirrors.ustc.edu.cn/anaconda/cloud/conda-forge/
conda config --add channels https://mirrors.ustc.edu.cn/anaconda/cloud/msys2/
conda config --add channels https://mirrors.bfsu.edu.cn/anaconda/pkgs/main/
conda config --add channels https://mirrors.bfsu.edu.cn/anaconda/pkgs/free/
conda config --remove channels defaults
注意操作完之后conda版本会变成22.x.x