zoukankan      html  css  js  c++  java
  • Manjaro、pip、conda更换国内源

    Manjaro

    1. 切换镜像源。执行以下命令,在稍后的弹窗中选择延迟最低的即可。

      sudo pacman-mirrors -i -c China -m rank
      
    2. 设置archlinuxcn源。在/etc/pacman.conf中添加以下命令,中科大源和清华源添加其中一个就可以了:

      [archlinuxcn]
      SigLevel = Optional TrustedOnly
      #中科大源
      Server = https://mirrors.ustc.edu.cn/archlinuxcn/$arch
      #清华源
      Server = https://mirrors.tuna.tsinghua.edu.cn/archlinuxcn/$arch
      
    3. 更新源列表:

      sudo pacman-mirrors -g
      
    4. 更新pacman数据库并更新系统:

      sudo pacman -Syyu
      
    5. 更新系统签名:

      sudo pacman -S archlinuxcn-keyring
      sudo pacman -S antergos-keyring
      

    pip

    1. 如果只是想临时从指定源下载某个文件,可以在下载命令后加入-i url来指定下载源,其中url是镜像源的地址。例如:

      pip install scrapy -i https://pypi.tuna.tsinghua.edu.cn/simple
      
    2. 永久更换。以添加阿里云的源为例:

      pip config set global.index-url https://mirrors.aliyun.com/pypi/simple/
      

      其中的https://mirrors.aliyun.com/pypi/simple/可以换成其他的镜像源地址。一些常见的源地址如下:

      阿里云 https://mirrors.aliyun.com/pypi/simple/
      中国科技大学 https://pypi.mirrors.ustc.edu.cn/simple/
      清华大学 https://pypi.tuna.tsinghua.edu.cn/simple/
      
    3. 恢复到默认的源。步骤2的命令执行后,配置在~/.pip/pip.conf中。想要换回默认源,只要把文件中相应的部分删掉旧可以了。(实在不行就把文件也删除)

    conda

    1. 以添加中科大源和清华源为例,以下两个添加一个即可:

      • 中科大源。在终端中执行以下命令:

        #USTC仓库镜像
        conda config --add channels https://mirrors.ustc.edu.cn/anaconda/pkgs/free/
        conda config --add channels https://mirrors.ustc.edu.cn/anaconda/pkgs/main/
        #Conda 附加库
        conda config --add channels https://mirrors.ustc.edu.cn/anaconda/cloud/conda-forge/
        conda config --add channels https://mirrors.ustc.edu.cn/anaconda/cloud/msys2/
        conda config --add channels https://mirrors.ustc.edu.cn/anaconda/cloud/bioconda/
        conda config --add channels https://mirrors.ustc.edu.cn/anaconda/cloud/menpo/
        #使之生效
        conda config --set show_channel_urls yes
        
      • 清华源:

        conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
        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/
        conda config --set show_channel_urls yes
        
        
    2. 换回默认源:

      conda config --remove-key channels
      
  • 相关阅读:
    C,C++,VC++有什么区别
    RF & Microarray
    偏最小二乘法
    各种机器学习方法的优缺点
    纠错输出编码法ECOC
    遗传算法GA
    支持向量机SVM
    神经网络NN
    机器学习的基本概念
    SPI通信协议(SPI总线)学习
  • 原文地址:https://www.cnblogs.com/SummerMorning/p/13993618.html
Copyright © 2011-2022 走看看