Python Conda添加、移除 Channel、宏包更新

1. Conda配置镜像源

conda配置镜像源,可以提高下载速度.

# 增加 Channel
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
# 显示 Channel
conda config --show-sources 

推荐几个常用的镜像源

channels:
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/peterjc123/
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/msys2/
  - https://mirrors.bfsu.edu.cn/anaconda/cloud/conda-forge/
  - https://mirrors.bfsu.edu.cn/anaconda/cloud/bioconda/
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
  - defaults

移除 镜像源

conda config –remove channels  https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/

查看 conda版本

conda list -r

安装版本conda 8

conda install --revision 8

其他: 慎重使用

conda clean -p
conda clean -c

2. Python宏包更新

pip更新:

pip install --upgrade some-package 

conda 更新

Conda upgrade  some-package 

出现:RemoveError: 'requests' is a dependency of conda and cannot be removed from conda's operating environment.

意味着需要更新conda

 conda update conda

如果还是不行,可以采取强制安装

conda update --force conda

你可能感兴趣的:(Python,anaconda,pip,编程语言)