Anaconda中如何配置國(guó)內(nèi)鏡像源安裝外部庫(kù)
一、conda下添加國(guó)內(nèi)鏡像源(window下)(永久添加)
1.配置清華鏡像源
直接在anaconda prompt下輸入以下代碼即可。
代碼如下:
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/
#設(shè)置搜索時(shí)顯示通道地址
conda config --set show_channel_urls yes
2.配置中科大鏡像源
代碼如下:
conda config --add channels https://mirrors.ustc.edu.cn/anaconda/pkgs/main/
conda config --add channels https://mirrors.ustc.edu.cn/anaconda/pkgs/free/
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.ustc.edu.cn/anaconda/cloud/bioconda/
conda config --add channels https://mirrors.ustc.edu.cn/anaconda/cloud/menpo/
#設(shè)置搜索時(shí)顯示通道地址
conda config --set show_channel_urls yes
3、配置上海交通大學(xué)鏡像源
命令如下:
conda config --add channels https://mirrors.sjtug.sjtu.edu.cn/anaconda/pkgs/main/
conda config --add channels https://mirrors.sjtug.sjtu.edu.cn/anaconda/pkgs/free/
conda config --add channels https://mirrors.sjtug.sjtu.edu.cn/anaconda/cloud/conda-forge/
# 設(shè)置搜索時(shí)顯示通道地址
conda config --set show_channel_urls yes
4、顯示添加的鏡像源
conda config --show channels
效果:
二、pip配置國(guó)內(nèi)鏡像源(window下,臨時(shí)修改)
1、配置pip鏡像源
可以在使用pip的時(shí)候加參數(shù)-i https://pypi.tuna.tsinghua.edu.cn/simple/
例如
pip install numpy -i 鏡像源網(wǎng)址
pip install numpy -i https://mirrors.aliyun.com/pypi/simple/
國(guó)內(nèi)常用源鏡像地址,可自行替換。
清華:https://pypi.tuna.tsinghua.edu.cn/simple/
阿里云:https://mirrors.aliyun.com/pypi/simple/
中國(guó)科技大學(xué): https://pypi.mirrors.ustc.edu.cn/simple/
華中理工大學(xué):https://pypi.hustunique.com/
山東理工大學(xué):https://pypi.sdutlinux.org/
豆瓣:https://pypi.douban.com/simple/文章來(lái)源:http://www.zghlxwxcb.cn/news/detail-679289.html
三、刪除鏡像源,換回默認(rèn)源
conda config --remove-key channels
謝謝?。。。?span toymoban-style="hidden">文章來(lái)源地址http://www.zghlxwxcb.cn/news/detail-679289.html
到了這里,關(guān)于Anaconda中如何配置國(guó)內(nèi)鏡像源安裝外部庫(kù)(含conda永久配置和pip臨時(shí)配置方法)的文章就介紹完了。如果您還想了解更多內(nèi)容,請(qǐng)?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!