zoukankan      html  css  js  c++  java
  • 更新Conda源和pip源

    更新conda源

    各系统都可以通过修改用户目录下的 .condarc 文件:

    channels:
      - defaults
    show_channel_urls: true
    default_channels:
      - 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/pkgs/r
    custom_channels:
      conda-forge: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
      msys2: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
      bioconda: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
      menpo: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
      pytorch: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
      simpleitk: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
    

    即可添加 Anaconda Python 免费仓库。Windows文件路径在C:Usersyourname.condarc,Mac文件路径在/Users/yourname/.condarc, 如没有或者无法直接创建名为 .condarc 的文件,可先执行 conda config --set show_channel_urls yes 生成该文件之后再修改。

    更新pip源

    清华的pypi 镜像每 5 分钟同步一次。

    临时使用

    pip install -i https://pypi.tuna.tsinghua.edu.cn/simple some-package
    

    注意,simple 不能少, 是 https 而不是 http

    设为默认

    升级 pip 到最新的版本 (>=10.0.0) 后进行配置:

    pip install pip -U
    pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
    

    此时会生成pip的配置文件,Windows配置文件为C:Usersyournamepippip.ini,Mac配置文件为/Users/yourname/.config/pip/pip.conf,内容为

    [global]
    index-url = https:``//pypi.tuna.tsinghua.edu.cn/simple
    

    如果到 pip 默认源的网络连接较差,临时使用镜像站来升级 pip:

    pip install -i https://pypi.tuna.tsinghua.edu.cn/simple pip -U
    

    参考

  • 相关阅读:
    HTB-靶机-Lazy
    HTB-靶机-Brainfuck
    HTB-靶机-October
    java编程思想-java注解
    HMAC的JAVA实现和应用
    HMACSHA1算法的JAVA实现
    常见软件安全漏洞样例代码
    [移动应用安全]移动应用安全培训PPT
    [标准性文档]WEB应用安全验证标准
    [安全测试报告]针对某厂商的一次渗透性测试
  • 原文地址:https://www.cnblogs.com/VVingerfly/p/12046586.html
Copyright © 2011-2022 走看看