python pip 安装包 记录 ubuntu and windows

Posted fluentsc

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了python pip 安装包 记录 ubuntu and windows相关的知识,希望对你有一定的参考价值。

以前因为win10下,pip安装太慢容易出错,所以离线下载许多包,现在想想自己好傻。可以通过修改下载源来解决问题。

1:windows

  编辑C:Users用户名AppDataRoamingpippip.ini(没有则新建),写入以下内容:

[global]
index-url = https://mirrors.aliyun.com/pypi/simple
[install]
trusted-host=mirrors.aliyun.com

 保存,然后在win+r打开cmd,用pip install下载就非常快了。

这个是把下载源换成阿里云。还可以换成清华源:

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

 2:ubuntu

  软件和更新里换成中国服务器就行

 

#话说我也是用了ubuntu后才想起来win可以换源,诶。

以上是关于python pip 安装包 记录 ubuntu and windows的主要内容,如果未能解决你的问题,请参考以下文章