python, pip install下载慢,超时,网络问题解决

pip从pypi下载第三方库存在网络问题,下载慢,超时,可以通过换源解决:

阿里镜像源是所有镜像源中最高效的,我们采用阿里镜像源.

1.从pip配置中修改下载源:(一劳永逸的方法)

将文件 ~/.pip/pip.conf 文件添加或修改:

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

[install]
trusted-host=mirrors.aliyun.com

2.(临时方法)命令,指定,源:

使用pip -i [source-url] [package]

pip install -i  https://mirrors.aliyun.com/pypi/simple/ tensorflow




原文地址:https://www.cnblogs.com/dynmi/p/12370991.html