美文网首页python
python-1.配置anaconda和pip的国内reposi

python-1.配置anaconda和pip的国内reposi

作者: logi | 来源:发表于2020-04-29 10:40 被阅读0次

    conda源

    conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/msys2/
    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/pkgs/free/
    conda config --set show_channel_urls yes
    

    检查配置结果

    conda info
    

    如下

         active environment : None
           user config file : /Users/clz/.condarc
     populated config files : /Users/clz/.condarc
              conda version : 4.8.3
        conda-build version : 3.10.5
             python version : 3.6.5.final.0
           virtual packages : __osx=10.14.6
           base environment : /Users/clz/anaconda3  (writable)
               channel URLs : https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/osx-64
                              https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/noarch
                              https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/osx-64
                              https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/noarch
                              https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/msys2/osx-64
                              https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/msys2/noarch
                              https://pypi.mirrors.ustc.edu.cn/simple/osx-64
                              https://pypi.mirrors.ustc.edu.cn/simple/noarch
                              https://pypi.tuna.tsinghua.edu.cn/simple/osx-64
                              https://pypi.tuna.tsinghua.edu.cn/simple/noarch
                              https://mirrors.aliyun.com/pypi/simple/osx-64
                              https://mirrors.aliyun.com/pypi/simple/noarch
                              https://repo.anaconda.com/pkgs/main/osx-64
                              https://repo.anaconda.com/pkgs/main/noarch
                              https://repo.anaconda.com/pkgs/r/osx-64
                              https://repo.anaconda.com/pkgs/r/noarch
              package cache : /Users/clz/anaconda3/pkgs
                              /Users/clz/.conda/pkgs
           envs directories : /Users/clz/anaconda3/envs
                              /Users/clz/.conda/envs
                   platform : osx-64
                 user-agent : conda/4.8.3 requests/2.18.4 CPython/3.6.5 Darwin/18.7.0 OSX/10.14.6
                    UID:GID : 501:20
                 netrc file : None
               offline mode : False
    
    • 在Windows中该配置文件.condarc位于 C:\Users\user_name.condarc
    • 在Linux中该配置文件.condarc位于 ~/.condarc

    pip源

    # Windows环境,在C:\user\username\pip\pip.ini(自行创建)中加入:
    [global]
    index-url=https://pypi.tuna.tsinghua.edu.cn/simple 
    [install]  
    trusted-host=pypi.tuna.tsinghua.edu.cn
    disable-pip-version-check = true  
    timeout = 6000  
    
    
    # Linux环境
    cd ~/
    mkdir .pip
    cd .pip
    sudo vim pip.conf
    
    # 加入如下内容(其实就是指定tuna源)
    [global]
    index-url=https://pypi.tuna.tsinghua.edu.cn/simple 
    [install]  
    trusted-host=pypi.tuna.tsinghua.edu.cn
    disable-pip-version-check = true  
    timeout = 6000  
    

    相关文章

      网友评论

        本文标题:python-1.配置anaconda和pip的国内reposi

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