亚洲乱码中文字幕综合,中国熟女仑乱hd,亚洲精品乱拍国产一区二区三区,一本大道卡一卡二卡三乱码全集资源,又粗又黄又硬又爽的免费视频

Python?Anaconda以及Pip配置清華鏡像源代碼示例

 更新時間:2024年03月30日 14:36:38   作者:HuangZouZou  
Anaconda指的是一個開源的Python發(fā)行版本,其包含了conda、Python等180多個科學(xué)包及其依賴項,下面這篇文章主要給大家介紹了關(guān)于Python?Anaconda以及Pip配置清華鏡像源的相關(guān)資料,需要的朋友可以參考下

前言

提示:

最近換了新電腦,在使用Anaconda安裝Python包時,系統(tǒng)會自動從默認源下載安裝包,但是由于網(wǎng)絡(luò)訪問限制或網(wǎng)絡(luò)連接速度較慢等原因,會導(dǎo)致安裝失敗或安裝速度較慢。

因此,為了提高安裝速度和穩(wěn)定性,一些用戶選擇使用國內(nèi)的鏡像源,如清華鏡像源。配置清華鏡像源可以讓用戶從國內(nèi)的服務(wù)器上下載Python包,這可以加快下載速度,并減少由于網(wǎng)絡(luò)訪問限制導(dǎo)致的下載失敗等問題。

一、Conda配置清華鏡像源

1. 查看鏡像源

conda config --show channels

2. 刪除添加源,恢復(fù)默認源

conda config --remove-key channels

3. 添加清華鏡像源

#添加鏡像源
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
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/r
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/pro
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/msys2

#終端顯示包從哪個channel下載,以及下載地址是什么
conda config --set show_channel_urls yes

二、Pip配置清華鏡像源

1. 臨時使用清華鏡像源

代碼如下(示例):

# some-package代表你需要安裝的包
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple some-package

下面這種方式也是一樣的

pip install some-package -i https://pypi.tuna.tsinghua.edu.cn/simple

2.永久配置

代碼如下(示例):

pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple

三、國內(nèi)常用的鏡像源

pip install -i https://mirrors.aliyun.com/pypi/simple/ some-package

清華大學(xué)開源軟件鏡像站:https://pypi.tuna.tsinghua.edu.cn/simple
阿里云開源鏡像站:https://mirrors.aliyun.com/pypi/simple/
豆瓣:https://pypi.douban.com/simple/
中國科技大學(xué) https://pypi.mirrors.ustc.edu.cn/simple/

上海交通大學(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/

中國科學(xué)技術(shù)大學(xué)

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/

華中理工大學(xué):

conda config --add channels http://pypi.hustunique.com/

山東理工大學(xué):

conda config --add channels http://pypi.sdutlinux.org/ 

總結(jié)

到此這篇關(guān)于Python Anaconda以及Pip配置清華鏡像源的文章就介紹到這了,更多相關(guān)Anaconda及Pip配置清華鏡像源內(nèi)容請搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!

相關(guān)文章

最新評論