Manjaro、pip、conda更換國內(nèi)源的方法
Manjaro
切換鏡像源。執(zhí)行以下命令,在稍后的彈窗中選擇延遲最低的即可。
sudo pacman-mirrors -i -c China -m rank
設(shè)置archlinuxcn源。在/etc/pacman.conf中添加以下命令,中科大源和清華源添加其中一個(gè)就可以了:
[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
如果只是想臨時(shí)從指定源下載某個(gè)文件,可以在下載命令后加入-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/
中國科技大學(xué) https://pypi.mirrors.ustc.edu.cn/simple/
清華大學(xué) https://pypi.tuna.tsinghua.edu.cn/simple/
恢復(fù)到默認(rèn)的源。步驟2的命令執(zhí)行后,配置在~/.pip/pip.conf中。想要換回默認(rèn)源,只要把文件中相應(yīng)的部分刪掉舊可以了。(實(shí)在不行就把文件也刪除)
conda
以添加中科大源和清華源為例,以下兩個(gè)添加一個(gè)即可:
中科大源。在終端中執(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
換回默認(rèn)源:
conda config --remove-key channels
到此這篇關(guān)于Manjaro、pip、conda更換國內(nèi)源的方法的文章就介紹到這了,更多相關(guān)Manjaro、pip、conda更換國內(nèi)源內(nèi)容請(qǐng)搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!
相關(guān)文章
使用pandas中的DataFrame.rolling方法查看時(shí)間序列中的異常值
Pandas是Python中最受歡迎的數(shù)據(jù)分析和處理庫之一,提供了許多強(qiáng)大且靈活的數(shù)據(jù)操作工具,在Pandas中,DataFrame.rolling方法是一個(gè)強(qiáng)大的工具,在本文中,我們將深入探討DataFrame.rolling方法的各種參數(shù)和示例,以幫助您更好地理解和應(yīng)用這個(gè)功能2023-12-12Python圖像處理之目標(biāo)物體輪廓提取的實(shí)現(xiàn)方法
目標(biāo)物體的輪廓實(shí)質(zhì)是指一系列像素點(diǎn)構(gòu)成,這些點(diǎn)構(gòu)成了一個(gè)有序的點(diǎn)集,這篇文章主要給大家介紹了關(guān)于Python圖像處理之目標(biāo)物體輪廓提取的實(shí)現(xiàn)方法,需要的朋友可以參考下2021-08-08淺談Python中threading join和setDaemon用法及區(qū)別說明
這篇文章主要介紹了淺談Python中threading join和setDaemon用法及區(qū)別說明,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。一起跟隨小編過來看看吧2020-05-05解決Pytorch 加載訓(xùn)練好的模型 遇到的error問題
今天小編就為大家分享一篇解決Pytorch 加載訓(xùn)練好的模型 遇到的error問題,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。一起跟隨小編過來看看吧2020-01-01詳解python string類型 bytes類型 bytearray類型
這篇文章主要介紹了python string類型 bytes類型 bytearray類型,需要的朋友可以參考下2017-12-12完美解決TensorFlow和Keras大數(shù)據(jù)量內(nèi)存溢出的問題
這篇文章主要介紹了完美解決TensorFlow和Keras大數(shù)據(jù)量內(nèi)存溢出的問題,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。一起跟隨小編過來看看吧2020-07-07解決PyCharm IDE環(huán)境下,執(zhí)行unittest不生成測試報(bào)告的問題
這篇文章主要介紹了解決PyCharm IDE環(huán)境下,執(zhí)行unittest不生成測試報(bào)告的問題,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。一起跟隨小編過來看看吧2020-09-09