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

