使用清华源加速pip安装过程

修改pip下载源

清华源:

conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free 
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/pro

运行pip install 命令会从网站上下载指定的python包,默认是从 https://files.pythonhosted.org/ 网站上下载。这是个国外的网站,遇到网络情况不好的时候,可能会下载失败,我们可以通过命令,修改pip现在软件时的源。 格式:

pip install 包名 -i 国内源地址

示例: pip install flask -i https://pypi.mirrors.ustc.edu.cn/simple/ 就是从中国科技大学(ustc)的服务器上下载flask(基于python的第三方web框架)

国内常用的pip下载源列表:

  • 阿里云 http://mirrors.aliyun.com/pypi/simple/

  • 中国科技大学 https://pypi.mirrors.ustc.edu.cn/simple/

  • 豆瓣(douban) http://pypi.douban.com/simple/

  • 清华大学 https://pypi.tuna.tsinghua.edu.cn/simple/

  • 中国科学技术大学 http://pypi.mirrors.ustc.edu.cn/simple/

  • 物联沃分享整理
    物联沃-IOTWORD物联网 » 使用清华源加速pip安装过程

    发表评论