CondaHTTPError: HTTP 000 CONNECTION FAILED

[root@localhost ~]# conda install samtools
Solving environment: failed

CondaHTTPError: HTTP 000 CONNECTION FAILED for url <https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/linux-64/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.
ConnectionError(ReadTimeoutError("HTTPSConnectionPool(host='mirrors.tuna.tsinghua.edu.cn', port=443): Read timed out."))

之前配置清华镜像如下:

[root@localhost bin]# conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
[root@localhost bin]# conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
[root@localhost bin]# conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/
[root@localhost bin]# conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/bioconda/
[root@localhost bin]# conda config --set show_channel_urls yes 
[root@localhost bin]# conda config --get channels

后来修改.condarc文件(vi /root/.condarc),删除所有镜像,只添加这两个镜像。

[root@localhost ~]# cat /root/.condarc
channels:
 - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
 - https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/bioconda/
show_channel_urls: true

下载成功了:

[root@localhost ~]# conda install samtools
Solving environment: done

## Package Plan ##

  environment location: /root/miniconda3

  added / updated specs: 
    - samtools


The following packages will be downloaded:

    package                    |            build
    ---------------------------|-----------------
    bzip2-1.0.6                |       h14c3975_5         414 KB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
    libdeflate-1.0             |       h14c3975_1          43 KB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/bioconda
    ca-certificates-2019.1.23  |                0         126 KB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
    libcurl-7.64.0             |       h20c2e04_2         600 KB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
    curl-7.64.0                |       hbc83047_2         152 KB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
    samtools-1.9               |      h8571acd_11         636 KB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/bioconda
    krb5-1.16.1                |       h173b8e3_7         1.4 MB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
    openssl-1.1.1b             |       h7b6447c_1         4.0 MB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
    libssh2-1.8.0              |       h1ba5d50_4         233 KB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
    ------------------------------------------------------------
                                           Total:         7.5 MB

The following NEW packages will be INSTALLED:

    bzip2:           1.0.6-h14c3975_5  https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main     
    curl:            7.64.0-hbc83047_2 https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main     
    krb5:            1.16.1-h173b8e3_7 https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main     
    libcurl:         7.64.0-h20c2e04_2 https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main     
    libdeflate:      1.0-h14c3975_1    https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/bioconda
    libssh2:         1.8.0-h1ba5d50_4  https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main     
    samtools:        1.9-h8571acd_11   https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/bioconda

The following packages will be UPDATED:

    ca-certificates: 2018.03.07-0      defaults                                                     --> 2019.1.23-0       https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
    openssl:         1.1.1a-h7b6447c_0 defaults                                                     --> 1.1.1b-h7b6447c_1 https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main

Proceed ([y]/n)? y


Downloading and Extracting Packages
bzip2-1.0.6          | 414 KB    | ############################################ | 100% 
libdeflate-1.0       | 43 KB     | ############################################ | 100% 
ca-certificates-2019 | 126 KB    | ############################################ | 100% 
libcurl-7.64.0       | 600 KB    | ############################################ | 100% 
curl-7.64.0          | 152 KB    | ############################################ | 100% 
samtools-1.9         | 636 KB    | ############################################ | 100% 
krb5-1.16.1          | 1.4 MB    | ############################################ | 100% 
openssl-1.1.1b       | 4.0 MB    | ############################################ | 100% 
libssh2-1.8.0        | 233 KB    | ############################################ | 100% 
Preparing transaction: done
Verifying transaction: done
Executing transaction: done

小礼物走一走,



作者:湖红点鲑
链接:https://www.jianshu.com/p/a2bca03b9c16
来源:简书
简书著作权归作者所有,任何形式的转载都请联系作者获得授权并注明出处。
上一篇:[转载] 使用国内镜像源来加速python pypi包的安装


下一篇:使用pip 清华镜像安装TensorFlow