Manjaro、pip、conda更換國內(nèi)源的方法
Manjaro
切換鏡像源。執(zhí)行以下命令,在稍后的彈窗中選擇延遲最低的即可。
sudo pacman-mirrors -i -c China -m rank
設(shè)置archlinuxcn源。在/etc/pacman.conf中添加以下命令,中科大源和清華源添加其中一個就可以了:
[archlinuxcn] SigLevel = Optional TrustedOnly #中科大源 Server = https://mirrors.ustc.edu.cn/archlinuxcn/$arch #清華源 Server = https://mirrors.tuna.tsinghua.edu.cn/archlinuxcn/$arch
更新源列表:
sudo pacman-mirrors -g
更新pacman數(shù)據(jù)庫并更新系統(tǒng):
sudo pacman -Syyu
更新系統(tǒng)簽名:
sudo pacman -S archlinuxcn-keyring sudo pacman -S antergos-keyring
pip
如果只是想臨時從指定源下載某個文件,可以在下載命令后加入-i url來指定下載源,其中url是鏡像源的地址。例如:
pip install scrapy -i https://pypi.tuna.tsinghua.edu.cn/simple
永久更換。以添加阿里云的源為例:
pip config set global.index-url https://mirrors.aliyun.com/pypi/simple/
其中的https://mirrors.aliyun.com/pypi/simple/可以換成其他的鏡像源地址。一些常見的源地址如下:
阿里云 https://mirrors.aliyun.com/pypi/simple/
中國科技大學 https://pypi.mirrors.ustc.edu.cn/simple/
清華大學 https://pypi.tuna.tsinghua.edu.cn/simple/
恢復(fù)到默認的源。步驟2的命令執(zhí)行后,配置在~/.pip/pip.conf中。想要換回默認源,只要把文件中相應(yīng)的部分刪掉舊可以了。(實在不行就把文件也刪除)
conda
以添加中科大源和清華源為例,以下兩個添加一個即可:
中科大源。在終端中執(zhí)行以下命令:
#USTC倉庫鏡像 conda config --add channels https://mirrors.ustc.edu.cn/anaconda/pkgs/free/ conda config --add channels https://mirrors.ustc.edu.cn/anaconda/pkgs/main/ #Conda 附加庫 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/ #使之生效 conda config --set show_channel_urls yes
清華源:
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/ conda config --set show_channel_urls yes
換回默認源:
conda config --remove-key channels
到此這篇關(guān)于Manjaro、pip、conda更換國內(nèi)源的方法的文章就介紹到這了,更多相關(guān)Manjaro、pip、conda更換國內(nèi)源內(nèi)容請搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!
相關(guān)文章
python Manager 之dict KeyError問題的解決
今天小編就為大家分享一篇python Manager 之dict KeyError問題的解決,具有很好的參考價值,希望對大家有所幫助。一起跟隨小編過來看看吧2019-12-12
pandas基礎(chǔ)?Series與Dataframe與numpy對二進制文件輸入輸出
這篇文章主要介紹了pandas基礎(chǔ)Series與Dataframe與numpy對二進制文件輸入輸出,series是一種一維的數(shù)組型對象,它包含了一個值序列和一個數(shù)據(jù)標簽2022-07-07
python腳本生成caffe train_list.txt的方法
下面小編就為大家分享一篇python腳本生成caffe train_list.txt的方法,具有很好的參考價值,希望對大家有所幫助。一起跟隨小編過來看看吧2018-04-04
Python執(zhí)行遺傳編程gplearn庫使用實例探究
這篇文章主要為大家介紹了Python執(zhí)行遺傳編程gplearn庫使用實例探究,有需要的朋友可以借鑒參考下,希望能夠有所幫助,祝大家多多進步,早日升職加薪2024-01-01

