Manjaro、pip、conda更換國(guó)內(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ù)庫(kù)并更新系統(tǒng):
sudo pacman -Syyu
更新系統(tǒng)簽名:
sudo pacman -S archlinuxcn-keyring sudo pacman -S antergos-keyring
pip
如果只是想臨時(shí)從指定源下載某個(gè)文件,可以在下載命令后加入-i url來(lái)指定下載源,其中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/可以換成其他的鏡像源地址。一些常見(jiàn)的源地址如下:
阿里云 https://mirrors.aliyun.com/pypi/simple/
中國(guó)科技大學(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倉(cāng)庫(kù)鏡像 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 附加庫(kù) 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更換國(guó)內(nèi)源的方法的文章就介紹到這了,更多相關(guān)Manjaro、pip、conda更換國(guó)內(nèi)源內(nèi)容請(qǐng)搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!
相關(guān)文章
python Manager 之dict KeyError問(wèn)題的解決
今天小編就為大家分享一篇python Manager 之dict KeyError問(wèn)題的解決,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。一起跟隨小編過(guò)來(lái)看看吧2019-12-12
pandas基礎(chǔ)?Series與Dataframe與numpy對(duì)二進(jìn)制文件輸入輸出
這篇文章主要介紹了pandas基礎(chǔ)Series與Dataframe與numpy對(duì)二進(jìn)制文件輸入輸出,series是一種一維的數(shù)組型對(duì)象,它包含了一個(gè)值序列和一個(gè)數(shù)據(jù)標(biāo)簽2022-07-07
基于Python實(shí)現(xiàn)條形碼圖片識(shí)別程序
這篇文章主要為大家詳細(xì)介紹了如何基于Python實(shí)現(xiàn)一個(gè)簡(jiǎn)單的條形碼圖片識(shí)別程序,可以視頻圖片中的條形碼,感興趣的小伙伴可以跟隨小編學(xué)習(xí)一下2023-09-09
python腳本生成caffe train_list.txt的方法
下面小編就為大家分享一篇python腳本生成caffe train_list.txt的方法,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。一起跟隨小編過(guò)來(lái)看看吧2018-04-04
Python自定義命令行參數(shù)選項(xiàng)和解析器
這篇文章主要介紹了Python自定義命令行參數(shù)選項(xiàng)和解析器,本文主要使用的方法為argparse.ArgumentParser(),此模塊可以讓人輕松編寫用戶友好的命令行接口,程序定義它需要的參數(shù),需要的朋友可以參考下2023-07-07
Python執(zhí)行遺傳編程gplearn庫(kù)使用實(shí)例探究
這篇文章主要為大家介紹了Python執(zhí)行遺傳編程gplearn庫(kù)使用實(shí)例探究,有需要的朋友可以借鑒參考下,希望能夠有所幫助,祝大家多多進(jìn)步,早日升職加薪2024-01-01
使用python檢測(cè)主機(jī)存活端口及檢查存活主機(jī)
這篇文章主要介紹了使用python檢測(cè)主機(jī)存活端口及檢查存活主機(jī)的相關(guān)資料,需要的朋友可以參考下2015-10-10

