命令“/bin/sh -c sudo pip3 install -r requirements.txt”返回了一个非零代码:1
The command '/bin/sh -c sudo pip3 install -r requirements.txt' returned a non-zero code: 1
我 运行 遇到构建我的 Docker 容器的问题。不完全确定我需要在这里做什么。
Docker文件
FROM ubuntu:14.04
RUN apt-get update \
&& apt-get install -y tar git curl nano wget dialog net-tools build-essential \
&& apt-get install --no-install-recommends -y -q python3 python3-pip python3-dev
ADD . /bot
WORKDIR /bot
RUN sudo pip3 install -r requirements.txt
CMD ["python3", "app.py"]
Requirements.txt
Flask==0.10.1
Jinja2==2.8
MarkupSafe==0.23
Werkzeug==0.11.3
itsdangerous==0.24
lxml==3.5.0
requests==2.9.1
uWSGI==2.0.12
wikiquote==0.1.2
错误
http://hastebin.com/ipatorezos.coffee
[编辑] 这似乎可以解决问题。添加了其他输入。谢谢!
FROM ubuntu:14.04
RUN apt-get update \
&& apt-get install -y tar git curl nano wget dialog net-tools build-essential \
&& apt-get install --no-install-recommends -y -q python3 python3-pip python3-dev \
&& apt-get install -y libxml2-dev libxslt-dev python-dev zlib1g-dev
ADD . /bot
WORKDIR /bot
RUN pip3 install -r requirements.txt
CMD ["python3", "app.py"]
错误似乎在:
Using build configuration of libxslt
building 'lxml.etree' extension
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -fPIC -Isrc/lxml/includes -I/usr/include/python3.4m -c src/lxml/lxml.etree.c -o build/temp.linux-x86_64-3.4/src/lxml/lxml.etree.o -w
In file included from src/lxml/lxml.etree.c:323:0:
src/lxml/includes/etree_defs.h:14:31: fatal error: libxml/xmlversion.h: No such file or directory
#include "libxml/xmlversion.h"
来自“How to install lxml on Ubuntu”,添加到您的 Dockerfile:
&& apt-get install libxml2-dev libxslt-dev python-dev zlib1g-dev
另外,make sure your VM has enough memory (if the apt-get install
fails).
OP 确认完整的 apt-get 命令为:
RUN apt-get update \
&& apt-get install -y tar git curl nano wget dialog net-tools build-essential \
&& apt-get install --no-install-recommends -y -q python3 python3-pip python3-dev \
&& apt-get install -y libxml2-dev libxslt-dev python-dev zlib1g-dev
我 运行 遇到构建我的 Docker 容器的问题。不完全确定我需要在这里做什么。
Docker文件
FROM ubuntu:14.04
RUN apt-get update \
&& apt-get install -y tar git curl nano wget dialog net-tools build-essential \
&& apt-get install --no-install-recommends -y -q python3 python3-pip python3-dev
ADD . /bot
WORKDIR /bot
RUN sudo pip3 install -r requirements.txt
CMD ["python3", "app.py"]
Requirements.txt
Flask==0.10.1
Jinja2==2.8
MarkupSafe==0.23
Werkzeug==0.11.3
itsdangerous==0.24
lxml==3.5.0
requests==2.9.1
uWSGI==2.0.12
wikiquote==0.1.2
错误
http://hastebin.com/ipatorezos.coffee
[编辑] 这似乎可以解决问题。添加了其他输入。谢谢!
FROM ubuntu:14.04
RUN apt-get update \
&& apt-get install -y tar git curl nano wget dialog net-tools build-essential \
&& apt-get install --no-install-recommends -y -q python3 python3-pip python3-dev \
&& apt-get install -y libxml2-dev libxslt-dev python-dev zlib1g-dev
ADD . /bot
WORKDIR /bot
RUN pip3 install -r requirements.txt
CMD ["python3", "app.py"]
错误似乎在:
Using build configuration of libxslt
building 'lxml.etree' extension
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -fPIC -Isrc/lxml/includes -I/usr/include/python3.4m -c src/lxml/lxml.etree.c -o build/temp.linux-x86_64-3.4/src/lxml/lxml.etree.o -w
In file included from src/lxml/lxml.etree.c:323:0:
src/lxml/includes/etree_defs.h:14:31: fatal error: libxml/xmlversion.h: No such file or directory
#include "libxml/xmlversion.h"
来自“How to install lxml on Ubuntu”,添加到您的 Dockerfile:
&& apt-get install libxml2-dev libxslt-dev python-dev zlib1g-dev
另外,make sure your VM has enough memory (if the apt-get install
fails).
OP 确认完整的 apt-get 命令为:
RUN apt-get update \
&& apt-get install -y tar git curl nano wget dialog net-tools build-essential \
&& apt-get install --no-install-recommends -y -q python3 python3-pip python3-dev \
&& apt-get install -y libxml2-dev libxslt-dev python-dev zlib1g-dev