termcolor是一个python包,可以改变控制台输出的颜色。
在安装termcolor包时,出现报错。
原因是我所使用的Anaconda镜像源是清华的镜像地址,这个地址现已停止服务,因此,需要修改conda环境的镜像地址配置。
1、输入cdm调出命令控制窗口;
2、输入以下命令查看当前conda环境的镜像源地址:
conda config --show channels
可以看到我的环境是清华的地址:
我们需要将清华的镜像地址移除后,重新配置其他的镜像源;
3、使用以下命令移除原地址:
conda config --remove channels https://pypi.tuna.tsinghua.edu.cn/simple;
conda config --remove channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/;
conda config --add channels https://mirrors.ustc.edu.cn/anaconda/pkgs/free/;
根据自己的环境修改url地址即可
4、使用以下命令配置新的镜像地址,推荐使用中科大的镜像源
conda config --add channels https://mirrors.ustc.edu.cn/anaconda/pkgs/free/
5、再次查看配置环境
conda config --show channels
配置成功!
此时在此安装termcolor即可安装成功!