conda install 出錯

在下載包時出現下面的錯誤:

userdeMBP:pytorch user$ conda install -n deeplearning matplotlib
Solving environment: failedCondaHTTPError: HTTP 000 CONNECTION FAILED for url <https://repo.anaconda.com/pkgs/main/osx-64/repodata.json.bz2>
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.ConnectionError(MaxRetryError('HTTPSConnectionPool(host=\'repo.anaconda.com\', port=443): Max retries exceeded with url: /pkgs/main/osx-64/repodata.json.bz2 (Caused by ReadTimeoutError("HTTPSConnectionPool(host=\'repo.anaconda.com\', port=443): Read timed out. (read timeout=9.15)"))'))

一開始是調用config命令去設置清華的鏡像:

conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/c
conda config --set show_channel_urls yes //設置配置中的參數
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/

但是還是出錯:

(deeplearning) userdeMBP:~ user$ conda install matplotlib
Solving environment: failedCondaHTTPError: HTTP 404 NOT FOUND for url <https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/c/noarch/repodata.json>
Elapsed: 00:00.226091The remote server could not find the noarch directory for the
requested channel with url: https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/c

As of conda 4.3, a valid channel must contain a `noarch/repodata.json` and
associated `noarch/repodata.json.bz2` file, even if `noarch/repodata.json` is
empty. please request that the channel administrator create
`noarch/repodata.json` and associated `noarch/repodata.json.bz2` files.
$ mkdir noarch
$ echo '{}' > noarch/repodata.json
$ bzip2 -k noarch/repodata.jsonYou will need to adjust your conda configuration to proceed.
Use `conda config --show channels` to view your configuration's current state.
Further configuration help can be found at <https://conda.io/docs/config.html>.

后面發現可能是這個鏡像的問題,打開本地的.condrac文件,將設置的channels改成:

- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/bioconda/

后面再運行就發現成功了

?

(deeplearning) userdeMBP:~ user$ conda install matplotlib
Solving environment: done==> WARNING: A newer version of conda exists. <==current version: 4.5.12latest version: 4.6.8Please update conda by running$ conda update -n base -c defaults conda## Package Plan ##environment location: /anaconda3/envs/deeplearningadded / updated specs: - matplotlibThe following packages will be downloaded:package                    |            build---------------------------|-----------------tornado-5.1.1              |   py37h1de35cc_0         661 KB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/mainmatplotlib-3.0.2           |   py37h54f8f79_0         6.5 MB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/mainkiwisolver-1.0.1           |   py37h0a44026_0          56 KB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/mainpyparsing-2.3.1            |           py37_0         105 KB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/mainpytz-2018.9                |           py37_0         268 KB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/maincycler-0.10.0              |           py37_0          14 KB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/mainca-certificates-2019.1.23  |                0         126 KB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/mainopenssl-1.1.1b             |       h1de35cc_1         3.4 MB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/mainpython-dateutil-2.8.0      |           py37_0         281 KB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/maincertifi-2019.3.9           |           py37_0         155 KB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main------------------------------------------------------------Total:        11.6 MBThe following NEW packages will be INSTALLED:cycler:          0.10.0-py37_0        https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/mainkiwisolver:      1.0.1-py37h0a44026_0 https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/mainmatplotlib:      3.0.2-py37h54f8f79_0 https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/mainpyparsing:       2.3.1-py37_0         https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/mainpython-dateutil: 2.8.0-py37_0         https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/mainpytz:            2018.9-py37_0        https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/maintornado:         5.1.1-py37h1de35cc_0 https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main

The following packages will be UPDATED:ca-certificates: 2019.1.23-0          defaults                                                --> 2019.1.23-0       https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/maincertifi:         2019.3.9-py37_0      defaults                                                --> 2019.3.9-py37_0   https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/mainopenssl:         1.1.1b-h1de35cc_1    defaults                                                --> 1.1.1b-h1de35cc_1 https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main

Proceed ([y]/n)? y...
Preparing transaction: done
Verifying transaction: done
Executing transaction: done

?

之后如果設置了另一個函數再次進行install時,明明之前已經更改了channels,但如果還是遇見了這樣的問題:

(deeplearning2) userdeMBP:neural transfer user$ conda install matplotlib
Solving environment: failedCondaHTTPError: HTTP 000 CONNECTION FAILED for url <https://repo.anaconda.com/pkgs/r/osx-64/repodata.json.bz2>

解決辦法就是退出該環境,使用-n來指明下載的環境,這樣就不會出現這樣的問題了:

userdeMBP:pytorch user$ conda install -n deeplearning2 matplotlib

?

但是最好還是直接進入該環境下,使用pip install來安裝包,不容易出錯

轉載于:https://www.cnblogs.com/wanghui-garcia/p/10525015.html

本文來自互聯網用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權,不承擔相關法律責任。
如若轉載,請注明出處:http://www.pswp.cn/news/252134.shtml
繁體地址,請注明出處:http://hk.pswp.cn/news/252134.shtml
英文地址,請注明出處:http://en.pswp.cn/news/252134.shtml

如若內容造成侵權/違法違規/事實不符,請聯系多彩編程網進行投訴反饋email:809451989@qq.com,一經查實,立即刪除!

相關文章

算法入門經典 第三章

scanf 遇到tab或空格或換行符停下來1.例題2-1 7744問題 從數本身看 從個位數的數字看#include <iostream>#include<math.h>using namespace std; int main(){ for(int a1;a<9;a) { for(int b1;b<9;b) { int n1100*a11*b;//floor x 等于1的區間為[1,2),florr(…

Halcon :畸變矯正與標定(2)

相機標定1.相機標定是什么2.怎么使用halcon進行相機內外參標定&#xff1f; &#xff08;1&#xff09;搭建硬件1.**相機連好電腦&#xff0c;用相機廠家軟件打開相機&#xff0c;檢查一下相機是否正常。**2.**接下來使用halcon連接相機**&#xff08;2&#xff09;開始標定1.*…

jQuery2

一、層次選擇器 1、后代選擇器$("div p"):div中所有的p標簽元素 2、自帶選擇器$("div>p")&#xff1a;div中的子代是p的第一層元素 3、兄弟選擇器$("divp")和div是兄弟的p標簽 4、相鄰兄弟選擇器$("div~p")與div相鄰的p標簽 二、jQ…

HTTP協議詳解(轉載)

http://www.cnblogs.com/TankXiao/archive/2012/02/13/2342672.html 轉載于:https://www.cnblogs.com/youmei11/p/8608007.html

bzoj1016 [JSOI2008]最小生成樹計數

1016: [JSOI2008]最小生成樹計數 Time Limit: 1 Sec Memory Limit: 162 MBSubmit: 6032 Solved: 2452[Submit][Status][Discuss]Description 現在給出了一個簡單無向加權圖。你不滿足于求出這個圖的最小生成樹&#xff0c;而希望知道這個圖中有多少個不同的最小生成樹。&…

http請求概述

當瀏覽器輸入網址后 瀏覽器首先向DNS域名解析服務器發送請求。DNS反解析&#xff1a;根據瀏覽器請求地址中的域名&#xff0c;到DNS服務器中找到對應的服務器外網IP地址通過找到外網IP&#xff0c;向對應的服務器發請求&#xff08;首先訪問服務器的WEB站點管理工具&#xff1a…

Halcon:二維仿射變換實例探究

二維仿射變換&#xff0c;顧名思義就是在二維平面內&#xff0c;對對象進行平移、旋轉、縮放等變換的行為&#xff08;當然還有其他的變換&#xff0c;這里僅論述這三種最常見的&#xff09;。 Halcon中進行仿射變換的常見步驟如下&#xff1a; ① 通過hom_mat2d_identity算子…

劍指Offer-數組中重復的數字

題目描述 在一個長度為n的數組里的所有數字都在0到n-1的范圍內。 數組中某些數字是重復的&#xff0c;但不知道有幾個數字是重復的。也不知道每個數字重復幾次。請找出數組中任意一個重復的數字。 例如&#xff0c;如果輸入長度為7的數組{2,3,1,0,2,5,3}&#xff0c;那么對應的…

CSS2--字體樣式

## CSS2 字體樣式 ##### font-family 字體族 - 規定元素的字體系列 - 把多個字體作為一個"回退"系統保存.保證瀏覽器的支持 - Microsoft YaHei, tahoma, arial, Hiragino Sans GB, sans-serif ##### font 字體類型 - 襯線字體(serif)&#xff1a;在字的筆劃開始及結束…

虛擬機中訪問連接在物理機上的攝像機(使用橋接)

最近在使用攝像機SDK做開發&#xff0c;開發好之后物理機上沒有環境&#xff0c;所以弄了個虛擬機進行測試&#xff0c;就如何在虛擬機中連接攝像機做下記錄。 步驟 &#xff11;.物理機上對虛擬機的適配器和攝像機的適配器設置為相同網段并進行橋接&#xff08;注意與攝像機網…

Halcon:手眼標定——眼在手外與眼在手上

為什么需要九點標定&#xff1f; 為了得到機械和相機的關系&#xff0c;就好比人的手和眼的關系。我們用手將一個物體放到空間的一個位置&#xff0c;用眼看到這個物體&#xff0c;這也存在兩個坐標系&#xff0c;一個是手所在的運動空間的坐標系&#xff0c;一個是視網膜上成像…

grep 正則匹配

\{0,n\}&#xff1a;至多n次 \{\ 匹配/etc/passwd文件中數字出現只是數字1次到3次 匹配/etc/grub2.cfg文件以一個空格開頭匹配一個字符的文件的所有行 顯示以LISTEN結尾的行 顯示匹配右邊以LISTEN結尾匹配一個或者多個空格的所有輸出 分組及引用&#xff1a;講一個或者多個字符…

解決bash: mysql: command not found 的方法

rootDB-02 ~]# MySQL -u root-bash: mysql: command not found 原因:這是由于系統默認會查找/usr/bin下的命令&#xff0c;如果這個命令不在這個目錄下&#xff0c;當然會找不到命令&#xff0c;我們需要做的就是映射一個鏈接到/usr/bin目錄下&#xff0c;相當于建立一個鏈接文…

C#調用 Halcon引擎執行代碼

Halcon引擎可以直接執行halcon代碼&#xff0c;把halcon程序當做&#xff23;#的一個方法來調用&#xff0c;這樣可以減輕&#xff23;#這邊的程序負擔&#xff0c;而且可以避免內在泄露等bug的出現。還有一種好處是方便調試視覺代碼&#xff0c;你只需要啟動halcon&#xff0c…

面試時如何優雅地自我介紹?

閱讀本文大概需要 3.4 分鐘。 1.題記 有讀者提問&#xff1a;如何在面試當中做一個最好的自我介紹&#xff1f; 結合了一下自己面試以及面試別人&#xff08;模擬面試&#xff09;的一些經驗&#xff0c;簡單總結了幾點&#xff0c;供大家參考。 2.為什么要自我介紹 在面試官要…

Cache的一些總結

輸出緩存 這是最簡單的緩存類型&#xff0c;它保存發送到客戶端的頁面副本&#xff0c;當下一個客戶端發送相同的頁面請求時&#xff0c;此頁面不會重新生成&#xff08;在緩存有限期內&#xff09;&#xff0c;而是從緩存中獲取該頁面&#xff1b;當然由于緩存過期或被回收&am…

thinkphp5.0學習(九):TP5.0視圖和模板

原文地址&#xff1a;http://blog.csdn.net/fight_tianer/article/details/78602711 一、視圖 1.加載頁面 1.繼承系統控制器類return $this->fetch(參數1&#xff0c;參數2&#xff0c;參數3&#xff0c;參數4);參數1&#xff08;字符串&#xff09;&#xff1a;模板渲染參數…

C#中調用halcon引擎來執行hdev程序

調用halcon引擎有兩個直接的好處&#xff1a; 避免C# 與halcon代碼混編時可能產生的內存泄露問題 修改halcon程序時不用重新編譯C# 勇哥寫了一個示例&#xff0c;詳細的應用感受和缺點限制勇哥會持續做相關的總結給大家分享。 對于halcon17來說&#xff0c;要運行下面的程序…

Node.js Up and Runing 學習日記(八)

目錄 連接池基于一個簡單的Socker.io服務器連接池 生產環境通常由多種資源組成: web服務器,緩存服務器和數據庫服務器. 數據庫服務器通常部署在web服務器之外的獨立機器上,這使得面向公眾的網站不必重新配置和修改復雜的數據庫群就可以垂直增長了. 基于 為每一個請求創建一個甚…

036有效的數獨

1 #include "000庫函數.h"2 3 //一看&#xff0c;沒想出什么好法子&#xff0c;就遍歷了4 //最重要的是如何比較小九宮格的數據5 //44ms6 class Solution {7 public:8 bool isValidSudoku(vector<vector<char>>& board) {9 for (int i …