conda install 出错

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

userdeMBP:pytorch user$ conda install -n deeplearning matplotlib
Solving environment: failed

CondaHTTPError: 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: failed

CondaHTTPError: HTTP 404 NOT FOUND for url <https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/c/noarch/repodata.json>
Elapsed: 00: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.12
  latest version: 4.6.8

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.1              |   py37h1de35cc_0         661 KB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
    matplotlib-3.0.2           |   py37h54f8f79_0         6.5 MB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
    kiwisolver-1.0.1           |   py37h0a44026_0          56 KB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
    pyparsing-2.3.1            |           py37_0         105 KB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
    pytz-2018.9                |           py37_0         268 KB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
    cycler-0.10.0              |           py37_0          14 KB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
    ca-certificates-2019.1.23  |                0         126 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.0      |           py37_0         281 KB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
    certifi-2019.3.9           |           py37_0         155 KB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
    ------------------------------------------------------------
                                           Total:        11.6 MB

The following NEW packages will be INSTALLED:

    cycler:          0.10.0-py37_0        https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
    kiwisolver:      1.0.1-py37h0a44026_0 https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
    matplotlib:      3.0.2-py37h54f8f79_0 https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
    pyparsing:       2.3.1-py37_0         https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
    python-dateutil: 2.8.0-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.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/main
    certifi:         2019.3.9-py37_0      defaults                                                --> 2019.3.9-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 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

原文地址:https://www.cnblogs.com/wanghui-garcia/p/10525015.html

时间: 2024-07-30 21:14:39

conda install 出错的相关文章

conda install

conda install -c conda-forge opencv=3.2.0        install opencv conda create -n caffe27 python=2.7 anaconda        create a new env conda install -c anaconda caffe       inatall caffe 原文地址:https://www.cnblogs.com/ahuzcl/p/9218300.html

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

解决ubuntu的pip和apt-get太慢的问题 ubuntu国外龟速的源实在难受,还是自己动手更改一下各种pip 源和apt-get 的源吧,换了之后速度令人舒适! 更换pip源成清华源 临时使用: 可以在使用pip的时候加参数-i https://pypi.tuna.tsinghua.edu.cn/simple例如 pip install opencv-python -i https://pypi.tuna.tsinghua.edu.cn/simple 这样就从清华这边的镜像去安装open

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

通过搜索tensorflow然后运行,例如:$ conda install --channel https://conda.anaconda.org/jjh_cio_testing tensorflow-gpu==1.3.0 报错: CondaIOError: Missing write permissions in: /usr/local/anaconda3## You don't appear to have the necessary permissions to install pack

anaconda在本地安装软件conda install

安装完anaconda后,想在mac下安装pytorch,但是在用官网提供的安装方法一直安装不上pytorch和torchvision,估计是被墙了 conda install pytorch torchvision -c pytorch 所以我用到清华的镜像站找到了pytorch和torchvision相应的版本并下载下来 https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/osx-64/ 我下载了mac版本的pytorch-

ubuntu 更新源 或者 apt-get install 出错404 not found ,Failed to fetch

1.考虑是不是能上网 2.用apt-get update ,然后再试试apt-get install 如果apt-get update 也出现很多 404 not found 或者 failed to fetch ,就要考虑更换自己的源,百度搜 /etc/apt/sources.list 3.如果还不行,估计是Ubuntu版本太老了,没有维护的了. 比如我用11.04,sudo apt-get install open-vm-dkms 不行,sudo apt-get  update  不行,就死

国内npm install出错解决办法

node npm在前端开发中有非常完善的工具链,但是很可惜的是国内不知道是什么原因无法访问!有以下方法解决: $ npm config set registry http://r.cnpmjs.org或者: npm config set registry http://registry.npmjs.eunpm install 对于前端测试的一个jslib安装:npm install phantomjs --phantomjs_cdnurl=http://cnpmjs.org/downloads

对原来的模块修改后,最好在解释器里把修改好的代码重新写,否则F5运行py模块时,总是出错误,如缩进不对 如for语句没写冒号 就导致cmd sdist和install 出错

#F5运行py模块后,调用时不用import 直接函数名调用 nester.print_lol() 错误 >>> #此时,我还没有对cmd 给出setup.py sdist upload 命令呢,就已经可以调用新修改的nester.py了 >>> #setup.py 版本已经修改成3.6.3,,不过是修改nester.py前就修改的 总结:对原模块nester.py修改时,F5运行一下,确保没问题了,再sdist和install,即可调用新版模块.setup.py的版本

conda install 报错解决

conda create -n query-scorer-serving python=2.7 Solving environment: failed CondaError: No writable package cache directories found in('/data/conda/pkgs', '/opt/conda/pkgs') sudo conda create -n query-scorer-serving python=2.7 sudo: conda: command no

conda install安装太慢如何提速

conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/ conda config --set show_channel_urls yes 原文地址:https://www.cnblogs.com/douzujun/p/12247447.html