windows下pip换源

1。进入C盘用户文件夹,新建名为pip的目录,在pip目录下新建pip.ini的文件。结果如下所示。


在pip.ini中添加如下代码:

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

这是换成清华的源,在国内还是挺快的。如果要换成公司的源的话,相应的把清华网站改成公司网站即可。

如豆瓣:

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

猜你喜欢

转载自blog.csdn.net/lwgkzl/article/details/80935453