pip模块安装超时,设置代理或更换源

解决方法:设置代理或更换镜像

一、设置代理:https://www.python100.com/html/113744.html

二、更换镜像

# 查看配置
python -m pip config list

# 更换为阿里源
python -m pip config set global.index-url https://mirrors.aliyun.com/pypi/simple

# 更换为清华源
python -m pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple

或按如下操作:建个文件 ~/.pip/pip.conf, 内容如下:

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

[global]
timeout = 6000
index-url = http://e.pypi.python.org/simple
[install]
use-mirrors = true
mirrors = http://e.pypi.python.org

[global]
index-url = http://b.pypi.python.org/simple
[install]
use-mirrors = true
mirrors = http://b.pypi.python.org

你可能感兴趣的:(Python/Flask,pip)