Docker issue: /bin/sh: pip: not found

后端 未结 2 447
情歌与酒
情歌与酒 2021-01-17 13:26

So my dockerfile is :

FROM iron/python:2.7

WORKDIR /app
ADD . /app

RUN pip install --upgrade pip
RUN pip install -r ./requirements.txt

Re

相关标签:
2条回答
  • 2021-01-17 13:47

    For Python3:

    FROM ubuntu:latest
    WORKDIR /app
    ADD . /app
    RUN set -xe \
        && apt-get update \
        && apt-get install python3-pip
    RUN pip3 install --upgrade pip
    RUN pip3 install -r requirements.txt
    

    Thats it :-)

    0 讨论(0)
  • 2021-01-17 13:48

    You have to install pip first.

    FROM iron/python:2.7
    WORKDIR /app
    ADD . /app
    RUN set -xe \
        && apt-get update \
        && apt-get install python-pip
    RUN pip install --upgrade pip
    RUN pip install -r ./requirements.txt
    
    0 讨论(0)
提交回复
热议问题