Tag: lxml

我如何在docker中安装lxml

我想在docker中部署我的python项目,因为项目需要lxml,所以我在requirments.txt中写了lxml>=3.5.0 。 这是我的dockfile: FROM gliderlabs/alpine:3.3 RUN set -x \ && buildDeps='\ python-dev \ py-pip \ build-base \ ' \ && apk –update add python py-lxml $buildDeps \ && rm -rf /var/cache/apk/* \ && mkdir -p /app ENV INSTALL_PATH /app WORKDIR $INSTALL_PATH COPY requirements-docker.txt ./ RUN pip install -r requirements.txt COPY . . RUN apk del […]

不能在Python中导入lxml:3.4 docker容器

最有可能是由于资源限制,我无法在基于python:3.4的docker容器中安装(并因此构build)lxml。 因此,我正在安装包。 我的Dockerfile: FROM python:3.4 COPY ./ /source RUN apt-get update RUN apt-get install -y python3-lxml RUN pip install -r /source/requirements.txt 不幸的是,我无法import lxml ,即使只是在我的容器中运行Python,就像这样: ***@*****:/web/source# docker exec -i -t 84c4cbf09321 python Python 3.4.3 (default, May 26 2015, 19:20:24) [GCC 4.9.2] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import lxml Traceback […]