在下载包时出现下面的错误:

userdeMBP:pytorch user$ conda install -n deeplearning matplotlib
Solving environment: failed CondaHTTPError: HTTP 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: failed CondaHTTPError: HTTP NOT FOUND for url <https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/c/noarch/repodata.json>
Elapsed: :00.226091 The 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.json You 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.
latest version: 4.6. Please update conda by running $ conda update -n base -c defaults conda ## Package Plan ## environment location: /anaconda3/envs/deeplearning added / updated specs:
- matplotlib The following packages will be downloaded: package | build
---------------------------|-----------------
tornado-5.1. | py37h1de35cc_0 KB https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
matplotlib-3.0. | py37h54f8f79_0 6.5 MB https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
kiwisolver-1.0. | py37h0a44026_0 KB https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
pyparsing-2.3. | py37_0 KB https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
pytz-2018.9 | py37_0 KB https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
cycler-0.10. | py37_0 KB https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
ca-certificates-2019.1. | KB https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
openssl-1.1.1b | h1de35cc_1 3.4 MB https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
python-dateutil-2.8. | py37_0 KB https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
certifi-2019.3. | py37_0 KB https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
------------------------------------------------------------
Total: 11.6 MB The following NEW packages will be INSTALLED: cycler: 0.10.-py37_0 https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
kiwisolver: 1.0.-py37h0a44026_0 https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
matplotlib: 3.0.-py37h54f8f79_0 https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
pyparsing: 2.3.-py37_0 https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
python-dateutil: 2.8.-py37_0 https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
pytz: 2018.9-py37_0 https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
tornado: 5.1.-py37h1de35cc_0 https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main The following packages will be UPDATED: ca-certificates: 2019.1.- defaults --> 2019.1.- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
certifi: 2019.3.-py37_0 defaults --> 2019.3.-py37_0 https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
openssl: 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: failed CondaHTTPError: HTTP 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来安装包,不容易出错

conda install 出错的更多相关文章

  1. ubuntu更换pip install,apt-get,conda install 成国内源

    解决ubuntu的pip和apt-get太慢的问题 ubuntu国外龟速的源实在难受,还是自己动手更改一下各种pip 源和apt-get 的源吧,换了之后速度令人舒适! 更换pip源成清华源 临时使用 ...

  2. conda install 安装太慢怎么办?

    小编我在安装tensorflow和keras的过程中,安装进程太慢,小木棍一直在转圈...抓狂... 如何解决??? 使用清华提供的anaconda镜像,使用以后真的很快! Anaconda 镜像使用 ...

  3. pod install 出错

    今天使用cocoapods的时候在执行pod install出错,如下: 使用很多方法都不行,但是问题感觉应该是需要升级,所有就找到升级cocoapods:sudo gem install -n /u ...

  4. ubuntu 装tensorflow出现 conda install ERROR missing write permission错误

    通过搜索tensorflow然后运行,例如:$ conda install --channel https://conda.anaconda.org/jjh_cio_testing tensorflo ...

  5. sudo apt-get install 、 pip install和conda install的对比

    sudo apt-get install: apt-get可以用来安装软件.更新源,也可以用来更新自Ubuntu的典型依赖包. (sudo apt-get remove --purge 软件名称 su ...

  6. 【转载】 180623 Conda install 本地压缩包文件tar.bz2

    原文地址“ https://blog.csdn.net/qq_33039859/article/details/80785535 ----------------------------------- ...

  7. conda install -c anaconda

    有些包在conda默认的channels中不包含,比如cudatoolkit-8.0,cudnn等,这时只需要在conda install指令后加上-c anaconda即可.比如要下载cudatoo ...

  8. anaconda在本地安装软件conda install

    安装完anaconda后,想在mac下安装pytorch,但是在用官网提供的安装方法一直安装不上pytorch和torchvision,估计是被墙了 conda install pytorch tor ...

  9. conda install 失败 http404

    最近conda install keras出现各种问题,显示配置问你,配置了清华中科大的源,都不行 估计原因是:配置各种源太多,最后全部删除只留一个清华源,成功 暴力方法直接删除C:\Users\Ad ...

随机推荐

  1. react-conponent-secondesElapsed

    <!DOCTYPE html> <html> <head> <script src="../../build/react.js">& ...

  2. CSS字体样式属性

    font-size 字号大小 一般推荐使用相对长度(px ,em),不推荐使用绝对长度(in,cmm,mm,pt) font-family 字体 1.可以同时指定多个字体,中间用英文状态的逗号隔开,英 ...

  3. 吴恩达机器学习笔记 —— 7 Logistic回归

    http://www.cnblogs.com/xing901022/p/9332529.html 本章主要讲解了逻辑回归相关的问题,比如什么是分类?逻辑回归如何定义损失函数?逻辑回归如何求最优解?如何 ...

  4. C++基础概述

    阅读Android源码需要对C++基础语法有一定的认识,借此对C++做一个简单的语法认知. 1.数据类型 类型 关键字 布尔型 bool 字符型 char 整型 int 浮点型 float 双浮点型 ...

  5. 你不可不知的Java引用类型之——虚引用

    定义 虚引用是使用PhantomReference创建的引用,虚引用也称为幽灵引用或者幻影引用,是所有引用类型中最弱的一个.一个对象是否有虚引用的存在,完全不会对其生命周期构成影响,也无法通过虚引用获 ...

  6. MySQL5.7 搭建主从同步

    性能更好的新服务器申请下来了,我们决定在2台新服务器上使用mysql5.7,并且使用主从同步.读写分离架构,很不幸这个任务落到了我的头上.读写分离是在业务代码中实现的,在此不做详述,介绍一下我搭建My ...

  7. Android Room框架学习笔记

    一.使用 1.build.gradle引入 compile "android.arch.persistence.room:runtime:1.0.0" annotationProc ...

  8. 洗礼灵魂,修炼python(87)-- 知识拾遗篇 —— 线程(1)

    线程(上) 1.线程含义:一段指令集,也就是一个执行某个程序的代码.不管你执行的是什么,代码量少与多,都会重新翻译为一段指令集.可以理解为轻量级进程 比如,ipconfig,或者, python   ...

  9. 预热一下吧《实现Redis消息队列》

    应用场景 为什么要用redis?二进制存储.java序列化传输.IO连接数高.连接频繁 一.序列化 这里编写了一个java序列化的工具,主要是将对象转化为byte数组,和根据byte数组反序列化成ja ...

  10. 孟岩:怎么看待Coin与Token的关系?

    由于中英文的隔阂,很多在英文世界里一目了然.不言自明的词汇,翻译成中文之后意义模糊.难以理解.比如在区块链和加密数字货币领域,coin 和 token 的区别,很长时间困扰着我们,并且引发争论. 后来 ...