怎么解決windows與ubuntu平臺(tái)CondaHTTPError:HTTP000CONNECTIONFAILED問(wèn)題

怎么解決windows與ubuntu平臺(tái) CondaHTTPError: HTTP 000 CONNECTION FAILED 問(wèn)題,針對(duì)這個(gè)問(wèn)題,這篇文章詳細(xì)介紹了相對(duì)應(yīng)的分析和解答,希望可以幫助更多想解決這個(gè)問(wèn)題的小伙伴找到更簡(jiǎn)單易行的方法。

專業(yè)從事成都網(wǎng)站建設(shè)、成都網(wǎng)站設(shè)計(jì),高端網(wǎng)站制作設(shè)計(jì),小程序制作,網(wǎng)站推廣的成都做網(wǎng)站的公司。優(yōu)秀技術(shù)團(tuán)隊(duì)竭力真誠(chéng)服務(wù),采用HTML5+CSS3前端渲染技術(shù),自適應(yīng)網(wǎng)站建設(shè),讓網(wǎng)站在手機(jī)、平板、PC、微信下都能呈現(xiàn)。建站過(guò)程建立專項(xiàng)小組,與您實(shí)時(shí)在線互動(dòng),隨時(shí)提供解決方案,暢聊想法和感受。

0.引子

最近使用conda時(shí)遇到一個(gè)問(wèn)題:CondaHTTPError: HTTP 000 CONNECTION FAILED

Collecting package metadata (current_repodata.json): failed

CondaHTTPError: HTTP 000 CONNECTION FAILED for url <https://repo.anaconda.com/pkgs/main/linux-64/current_repodata.json>
Elapsed: -

An HTTP error occurred when trying to retrieve this URL.
HTTP errors are often intermittent, and a simple retry will get you on your way.

If your current network has https://www.anaconda.com blocked, please file
a support request with your network engineering team.

'https://repo.anaconda.com/pkgs/main/linux-64'

在Windows10與Ubuntu都遇到這個(gè)問(wèn)題,分析原因可能是筆者所在的網(wǎng)絡(luò)由于某些信息無(wú)法訪問(wèn)默認(rèn)conda網(wǎng)絡(luò)完成驗(yàn)證。

1.解決

解決的思路并不復(fù)雜,修改conda配置信息。

1.0:Ubuntu解決方法

推薦第一步配置conda為清華源:

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/pkgs/free/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
conda config --append channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/fastai/
conda config --append channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/
conda config --append channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/bioconda/
 

conda config --set show_channel_urls yes

修改conda配置信息:

vim ~/.condarc

改為:關(guān)鍵點(diǎn) 刪除 - defaults 增加 ssl_verify: false,如果不太清楚如何修改,直接把下方內(nèi)容替換掉~(yú)/.condarc中的內(nèi)容

channels:
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/Paddle/
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/fastai/
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/bioconda/
show_channel_urls: true
ssl_verify: false

保存以后Ubuntu的這個(gè)問(wèn)題就解決了。

1.1:Windows解決方法

第一步上面類似,推薦先配置conda為清華源:

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/pkgs/free/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
conda config --append channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/fastai/
conda config --append channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/
conda config --append channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/bioconda/
 

conda config --set show_channel_urls yes

修改conda配置信息:Windows的.condarc一般位于C盤C:\Users\xiaos下面,這個(gè)xiaos是筆者命名的,這個(gè)根據(jù)自己的來(lái)看。

因?yàn)?condarc默認(rèn)是隱藏的,所以需要在查看里面,勾選隱藏的項(xiàng)目,

怎么解決windows與ubuntu平臺(tái) CondaHTTPError: HTTP 000 CONNECTION FAILED 問(wèn)題

直接通過(guò)記事本打開(kāi)修改,關(guān)鍵點(diǎn) 刪除 - defaults 增加 ssl_verify: false,如果不太清楚如何修改,直接把下方內(nèi)容替換掉.condarc中的內(nèi)容

channels:
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/Paddle/
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/msys2/
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/fastai/
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/bioconda/
show_channel_urls: true
ssl_verify: false

然后保存退出即可

關(guān)于怎么解決windows與ubuntu平臺(tái) CondaHTTPError: HTTP 000 CONNECTION FAILED 問(wèn)題問(wèn)題的解答就分享到這里了,希望以上內(nèi)容可以對(duì)大家有一定的幫助,如果你還有很多疑惑沒(méi)有解開(kāi),可以關(guān)注創(chuàng)新互聯(lián)行業(yè)資訊頻道了解更多相關(guān)知識(shí)。

文章題目:怎么解決windows與ubuntu平臺(tái)CondaHTTPError:HTTP000CONNECTIONFAILED問(wèn)題
文章出自:http://bm7419.com/article16/gipodg.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供企業(yè)建站、標(biāo)簽優(yōu)化、網(wǎng)站收錄、網(wǎng)站內(nèi)鏈域名注冊(cè)、微信小程序

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來(lái)源: 創(chuàng)新互聯(lián)

手機(jī)網(wǎng)站建設(shè)