Python利用国内镜像安装第三方库

Posted 袁小雨

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Python利用国内镜像安装第三方库相关的知识,希望对你有一定的参考价值。

镜像站点是将网站的多个副本放置不同的服务器,这样可能提高反应速度,用户可以在访问较少或相对速度较快的服务器上取得信息。目前国内的常用镜像站网址有:

               阿里云 http://mirrors.aliyun.com/pypi/simple/
        中国科技大学 https://pypi.mirrors.ustc.edu.cn/simple/
        豆瓣 http://pypi.douban.com/simple/
        清华大学 https://pypi.tuna.tsinghua.edu.cn/simple/
        中国科学技术大学 http://pypi.mirrors.ustc.edu.cn/simple/

 

    设置方法,以清华镜像源为例:

    临时使用pip install -i https://pypi.tuna.tsinghua.edu.cn/simple xx

    永久设置pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple

 

以上是关于Python利用国内镜像安装第三方库的主要内容,如果未能解决你的问题,请参考以下文章