美文网首页linux
conda操作-1| conda镜像源查看、国内镜像添加与删除

conda操作-1| conda镜像源查看、国内镜像添加与删除

作者: 切瓜少年 | 来源:发表于2020-10-24 19:23 被阅读0次

    1、镜像源查看

    $ conda config --show-sources
    

    2、国内第三方源添加

    conda config --add channels http://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/
    conda config --add channels http://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/bioconda/
    conda config --add channels http://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/
    conda config --add channels http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
    conda config --add channels http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
    conda config --add channels https://anaconda.mirrors.sjtug.sjtu.edu.cn/pkgs/main
    conda config --add channels https://anaconda.mirrors.sjtug.sjtu.edu.cn/pkgs/free
    conda config --add channels https://anaconda.mirrors.sjtug.sjtu.edu.cn/pkgs/mro
    conda config --add channels https://anaconda.mirrors.sjtug.sjtu.edu.cn/pkgs/msys2
    conda config --add channels https://anaconda.mirrors.sjtug.sjtu.edu.cn/pkgs/pro
    conda config --add channels https://anaconda.mirrors.sjtug.sjtu.edu.cn/pkgs/r
    

    3、删除源

    $ conda config --remove channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
    

    4、源报错处理

    报错:

    (base) root@ecs-88e2:~# conda create scanpy python=3.7
    
    CondaValueError: The target prefix is the base prefix. Aborting.
    
    (base) root@ecs-88e2:~# conda create -n scanpy python=3.7
    Collecting package metadata (current_repodata.json): failed
    
    CondaHTTPError: HTTP 000 CONNECTION FAILED for url <https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/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.
    'https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/linux-64'
    

    处理:查看并删除报错的源

    (base) root@ecs-88e2:~# conda config --show-sources
    ==> /root/.condarc <==
    channels:
      - https://anaconda.mirrors.sjtug.sjtu.edu.cn/pkgs/r
      - https://anaconda.mirrors.sjtug.sjtu.edu.cn/pkgs/pro
      - https://anaconda.mirrors.sjtug.sjtu.edu.cn/pkgs/msys2
      - https://anaconda.mirrors.sjtug.sjtu.edu.cn/pkgs/mro
      - https://anaconda.mirrors.sjtug.sjtu.edu.cn/pkgs/free
      - https://anaconda.mirrors.sjtug.sjtu.edu.cn/pkgs/main
      - 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/pytorch/
      - https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/bioconda/
      - https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/
      - defaults
    
    (base) root@ecs-88e2:~# conda config --remove channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/
    (base) root@ecs-88e2:~# conda config --show-sources
    ==> /root/.condarc <==
    channels:
      - https://anaconda.mirrors.sjtug.sjtu.edu.cn/pkgs/r
      - https://anaconda.mirrors.sjtug.sjtu.edu.cn/pkgs/pro
      - https://anaconda.mirrors.sjtug.sjtu.edu.cn/pkgs/msys2
      - https://anaconda.mirrors.sjtug.sjtu.edu.cn/pkgs/mro
      - https://anaconda.mirrors.sjtug.sjtu.edu.cn/pkgs/free
      - https://anaconda.mirrors.sjtug.sjtu.edu.cn/pkgs/main
      - 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/pytorch/
      - https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/bioconda/
      - defaults
    
    (base) root@ecs-88e2:~# conda create -n scanpy python=3.7
    Collecting package metadata (current_repodata.json): done
    Solving environment: done
    

    相关文章

      网友评论

        本文标题:conda操作-1| conda镜像源查看、国内镜像添加与删除

        本文链接:https://www.haomeiwen.com/subject/vldwmktx.html