[英]Command “python setup.py egg_info” failed with error code 1 in /tmp/pip-build-dlih6aks/MarkupSafe/
I am practicing Docker with https://courses.cognitiveclass.ai/ and I tried to run a Dockerfile
with the following content.我正在使用https://courses.cognitiveclass.ai/练习 Docker,并尝试运行包含以下内容的Dockerfile
。
FROM python:3.6.1-alpine
RUN pip install flask
CMD ["python","app.py"]
COPY app.py /app.py
The command I used to run Dockerfile
我用来运行Dockerfile
的命令
sudo docker image build -t python-hello-world .
when I executed this it was completing only 1/5 step and 2/5 step was failing with following error s.当我执行此操作时,它仅完成了 1/5 步,而 2/5 步因以下错误而失败。
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-dlih6aks/MarkupSafe/
You are using pip version 9.0.1, however version 21.2.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
The command '/bin/sh -c pip install flask' returned a non-zero code: 1
Do I need to add any changes to the Dockerfile
?我需要对Dockerfile
添加任何更改吗?
References: https://courses.cognitiveclass.ai/courses/course-v1:IBMDeveloperSkillsNetwork+CO0101EN+v1/courseware/a4f90ba011b740f3b2542acd5fcb7ca6/1baf0640d41543fc9c8b832068551d2c/?child=first参考资料: https : //courses.cognitiveclass.ai/courses/course-v1 : IBMDeveloperSkillsNetwork+CO0101EN+ v1/ courseware/ a4f90ba011b740f3b2542acd5fcb7ca6/ 1baf0640d41543fc9c8b85122first
Looks like something's not right with installing Markupsafe>=2 (even on it's own), not sure exactly what it is just yet but as a quick fix you can install previous version before installing flask and it will be replaced with the proper v.2 during flask install but you'll avoid the error:看起来安装 Markupsafe>=2 (即使是它自己的)有些不对劲,不确定它到底是什么,但作为快速修复,您可以在安装 Flask 之前安装以前的版本,它将被正确的 v.2 替换在烧瓶安装期间,但您将避免错误:
RUN pip install markupsafe==1.1.1 flask
UPDATE : or even better solution might be to use a more recent python image:更新:甚至更好的解决方案可能是使用更新的 python 图像:
FROM python:3.9-alpine
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.