Conda and pip in the anaconda virtual environment quickly change the source/display the source/delete the source

Conda for Tsinghua source

conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge 
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/msys2/

# 从channel中安装包时显示channel的url,这样就可以知道包的安装来源了
conda config --set show_channel_urls yes

conda show all sources

conda config --show channels

conda deletes the specified source

conda config --remove channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/

pip for Tsinghua source

pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple

pip show all sources

pip config list

pip remove source

pip config unset global.index-url

Guess you like

Origin blog.csdn.net/weixin_45747759/article/details/116076966