老师 安装flask失败

来源:4-8 多容器复杂应用的部署演示

精慕门8459013

2018-09-20

老师,你好,我使用dockerfile生成镜像,安装flask和redis失败,报错如下

[vagrant@bogon flask-docke]$ sudo docker build -t xinsir8/flask-redis .
Sending build context to Docker daemon 3.072kB
Step 1/7 : FROM python:2.7
—> 4ee4ea2f0113
Step 2/7 : LABEL maintaner=“Peng Xiao xiaoquwl@gmail.com
—> Using cache
—> 31f4bdd97ec9
Step 3/7 : COPY . /app
—> Using cache
—> 1c6a6e943618
Step 4/7 : WORKDIR /app
—> Using cache
—> 41561c8c394e
Step 5/7 : RUN pip install flask redis
—> Running in 605ced9befb6
Collecting flask
Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by ‘SSLError(SSLError(1, u’[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:726)’),)’: /simple/flask/
Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by ‘SSLError(SSLError(1, u’[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:726)’),)’: /simple/flask/
Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by ‘SSLError(SSLError(1, u’[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:726)’),)’: /simple/flask/
Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by ‘SSLError(SSLError(1, u’[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:726)’),)’: /simple/flask/
Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by ‘SSLError(SSLError(1, u’[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:726)’),)’: /simple/flask/
Could not fetch URL https://pypi.org/simple/flask/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host=‘pypi.org’, port=443): Max retries exceeded with url: /simple/flask/ (Caused by SSLError(SSLError(1, u’[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:726)’),)) - skipping
Could not find a version that satisfies the requirement flask (from versions: )
No matching distribution found for flask
Could not fetch URL https://pypi.org/simple/pip/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host=‘pypi.org’, port=443): Max retries exceeded with url: /simple/pip/ (Caused by SSLError(SSLError(1, u’[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:726)’),)) - skipping
The command ‘/bin/sh -c pip install flask redis’ returned a non-zero code: 1
[vagrant@bogon flask-docke]$

写回答

3回答

麦兜搞IT

2020-04-13

应该是你的网络的设置问题,您是在公司网络里用的么》

可以试试把pip install flask redis 换成

pip install flask redis --trusted-host pypi.org --trusted-host files.pythonhosted.org


0
0

在路上前行

2020-04-11

可以访问这个网址,也遇到了同样的问题。请问怎么解决的

0
0

麦兜搞IT

2018-09-21

您好,我感觉您的网络有问题呢?您在本地能访问比如 https://pypi.org/simple/pip/ 么

0
2
在路上前行
可以访问这个网址,也遇到了同样的问题。请问怎么解决的
2020-04-11
共2条回复

系统学习Docker 践行DevOps理念

无论你是开发、测试还是运维,Docker都是你的必备技能。

3297 学习 · 1895 问题

查看课程