Tag: pip

我怎样才能在docker文件中安装Python的Python?

我有我自己的dockerfile,它使用gdal和其他几个包创build一个图像: FROM geodata/gdal:2.1.2 USER root RUN apt-get update && apt-get install -y \ build-essential \ gfortran \ libatlas-base-dev \ python-pip \ python-dev \ libxft-dev libfreetype6 libfreetype6-dev RUN apt-get install -y python-tk RUN pip install \ numpy \ matplotlib \ scipy \ click \ Pillow \ scikit-image \ Cython \ packaging RUN apt-get install -y liblas-c3 […]

Gitlab跨项目依赖 – python

我需要一点帮助。 我在GitLab上有两个私有仓库,第一个是generics​​代码(我们把它称为generics项目 ),第二个是我们称之为main-project的generics代码,它是从genericsinheritance而来,是更大的docker-compose项目的一部分。 我有gitlab CI设置build立docker图像每次推到主项目的主分支发生。 我的目标是使主项目自动安装从generics项目的依赖关系,当提到推动发生,或类似的东西。 我已经尝试添加类似“运行pip安装git + < generic-project >”,但它失败,因为它是私人存储库,需要下载凭据。 我一直在考虑制作一个小型的docker镜像,在其中运行generic-project ,在main-project image里面运行,但是到目前为止我还是无法工作。 我会非常感激任何想法和build议。

docker错误该命令非零代码:1 python

我有问题,当我试图build立容器。 而错误是: The command '/bin/sh -c pip install -r requirements.txt' returned a non-zero code: 1 我不知道为什么,我按照从文档的代码,但总是得到错误。 Dockerfile FROM python:2.7-slim # # # Set the working directory to /app WORKDIR /app # # # Copy the current directory contents into the container at /app ADD . /app # # # Install any needed packages specified in […]

ImportError:没有模块在Docker中使用pip命名包

我使用Docker来构build我的应用程序。 我使用pip从requirements.txt安装软件包,但软件包不包含在构build中。 FROM python:3.4 WORKDIR /app ADD . /app RUN apt-get update && apt-get install -y \ python3-pip python-pip\ cron \ unixodbc \ unixodbc-dev \ python3-dev \ python3-setuptools \ && rm -rf /var/lib/apt/lists/* RUN pip install –upgrade pip RUN pip install sendgrid RUN pip3 install -r requirements.txt ENV CONFIG_ENV .env ADD validator-cron /etc/cron.d/validator-cron-job RUN chmod […]

Docker pip安装创buildrecursiontmp / pip-build / tmp / pip-build …文件夹

我对Docker和Python应用程序有点新鲜。 我遇到了一个非常令人困惑的问题,经过一些推动,我奇迹般的解决了这个问题。 但是,我既不了解问题,也不了​​解解决scheme,并且要同时理解。 所以我在我的应用程序的根目录中有一个Dockerfile,可以这样做: COPY . . RUN apt-get update && apt-get install -y enchant \ && pip install –extra-index-url=${ARTIFACTORY} –no-cache-dir requirements.txt \ && pip install . \ # installs my python app using setup.py && python -m app.run_model ENTRYPOINT … 由于磁盘空间不足,一直失败。 好的,好吧,我删除了旧的,未使用的图像。 但是我不认为这是问题,因为它一直在失败,并且还产生了这些超长,超级怪异的recursion文件名,如: /tmp/pip-fih7z5-build/tmp/pip-fih7z5-build/tmp/pip-fih7z5-build/tmp/pip-fih7z5-build/tmp/pip-fih7z5-build/tmp/pip-fih7z5-build/tmp/pip-fih7z5-build/tmp/pip-fih7z5-build/tmp/pip-fih7z5-build/tmp/pip-fih7z5-build/tmp/pip-fih7z5-build/… 在Docker命令周围添加下面的包装器有点奏效: COPY . /workdir RUN cd /workdir \ … && […]

为什么我的容器不能find一个点子安装包(通过git)?

我有一个Dockerfile FROM ubuntu:xenial LABEL maintainer="info@martin-thoma.com" # Settings for the local user to create ENV APP_USER docker ENV APP_USER_UID 9999 ENV APP_USER_GROUP docker ENV APP_USER_GROUP_GID 4711 ENV PYTHONIOENCODING utf-8 # Install and update software RUN apt-get update -y && apt-get install -y –fix-missing git python-pip python-dev build-essential poppler-utils libmysqlclient-dev RUN pip install pip –upgrade # Copy […]

Docker-compose连接外部/本地mysql

我有问题,无法与我的本地主机mysql连接。 DockerFile FROM python:2.7 WORKDIR /app ADD . /app RUN pip install -r requirements.txt EXPOSE 80 ENV NAME HelloWorld CMD ["python", "app.py"] 泊坞窗,compose.yml version: '2' services: web: build: . command: python app.py volumes: – .:/app ports: – "8000:8000" requirement.txt SQLAlchemy == 1.1.14 python_dateutil == 2.4.2 requests == 2.10.0 tornado == 4.4.2 当我在terminal键入命令: docker-compose build docker-compose […]

Docker镜像在CentOS中失败,但在MacOS上工作

我正在使用下面的Dockerfile: FROM centos RUN yum -y -q install epel-release && yum -y -q update && yum clean all \ && yum -y -q install python-pip COPY requirements.txt /tmp/ RUN pip install -q pyvmomi==6.5.0.2017.5.post1 不知道为什么它使用17.09.0-ce在MacOS上正常工作,但是没有使用CentOS和17.11.0-ce-rc3 。 在pip安装中有一个错误,在这个例子中我使用了pyvmomi但是我和其他软件包有类似的错误。 Step 3/3 : RUN pip install pyvmomi==6.5.0.2017.5.post1 —> Running in 49d94b300e7f Collecting pyvmomi==6.5.0.2017.5.post1 Downloading pyvmomi-6.5.0.2017.5-1.tar.gz (252kB) Collecting requests>=2.3.0 (from […]

试图在Docker镜像上安装selenium python3软件包

我试过用selenium python包重新构build一个Docker镜像失败。 我不知道如何继续。 这是我的dockerfile: FROM selenium/standalone-chrome:latest WORKDIR /usr/local/bin RUN sudo apt-get update RUN sudo apt-get install software-properties-common RUN sudo apt-add-repository universe RUN sudo apt-get install python-pip RUN pip3 install -r requirements.txt RUN pip3 install . RUN pip3 install -e . COPY ./* ./ 我相当确定这是我的dockerfile是错误的,但尝试各种安装点的方法后,我画了一个空白。 在任何情况下,我然后调用:docker build -t webdriver。 其中输出以下内容: Sending build context to Docker daemon […]

为什么“pip install”不能在debian docker容器中使用Flask和gevent?

我正在试图用瓶子和geventbuild造一个docker集装箱,而且它并不像我所希望的那样工作。 我可以一起破解,但为什么不安装工作? 下面的全部细节。 Dockerfile: FROM debian:jessie 构build容器: docker build –pull –no-cache -t flask-test . 运行容器: docker run -it flask-test /bin/bash 在容器内: apt-get update apt-get -y install python-pip apt-get -y install python-dev pip install Flask gevent testing: python -c "from flask import Flask" 错误: root@2fe825b7f55e:/# python -c "from flask import Flask" Traceback (most recent call last): […]