简体   繁体   English

命令“python setup.py egg_info”在 /tmp/pip-build-dlih6aks/MarkupSafe/ 中失败,错误代码为 1

[英]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.

相关问题 Python - 命令“python setup.py egg_info”在 /tmp/pip-build-21ft0H/pandas 中失败,错误代码为 1 - Python - Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-21ft0H/pandas 无法安装Django:命令“python setup.py egg_info”失败,错误代码1在/ tmp / pip-build-rcF9a5 / Django / - Trouble installing Django: Command “python setup.py egg_info” failed with error code 1 in /tmp/pip-build-rcF9a5/Django/ 命令“ python setup.py egg_info”在/ tmp / pip-build-hg0dbjgz / mysqlclient /中失败,错误代码为1 - Command “python setup.py egg_info” failed with error code 1 in /tmp/pip-build-hg0dbjgz/mysqlclient/ 命令“python setup.py egg_info”在 /tmp/pip-build-tu6ygqzj/mysql-python/ 中失败,错误代码为 1 - Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-tu6ygqzj/mysql-python/ InstallationError:/ tmp / pip-build-Jr1szu / Django /中的命令“ python setup.py egg_info”失败,错误代码为1 - InstallationError: Command “python setup.py egg_info” failed with error code 1 in /tmp/pip-build-Jr1szu/Django/ ctcdecode 安装失败 - 命令“python setup.py egg_info”在 /tmp/pip-req-build-7zcjual1/ 中失败,错误代码为 1 - ctcdecode install fail - Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-req-build-7zcjual1/ 命令“python setup.py egg_info”在 /tmp/pip-build-hn4hol_z/spacy/ 中失败,错误代码为 1 - Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-hn4hol_z/spacy/ 命令“python setup.py egg_info”失败,/tmp/pip-build-e7AmlG/django-filter 中的错误代码为 1 - Command “python setup.py egg_info” failed with error code 1 in /tmp/pip-build-e7AmlG/django-filter 配置返回的代码256 - python setup.py egg_info失败,错误代码为1 / tmp / pip_build_root / lxml - configure returned code 256 - python setup.py egg_info failed with error code 1 in /tmp/pip_build_root/lxml / tmp / pip-install-_p77_6kw / poster /中的命令“ python setup.py egg_info”失败,错误代码为1 - Command “python setup.py egg_info” failed with error code 1 in /tmp/pip-install-_p77_6kw/poster/
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM