无法在 ubuntu 18.04 docker /bin/sh: 1: pip: not found 中安装 pip

Kou*_*kou 3 python pip docker dockerfile ubuntu-18.04

我在我的 docker 映像中使用 pip 收到错误消息。

FROM ubuntu:18.04

RUN apt-get update && apt-get install -y \
    software-properties-common
RUN add-apt-repository universe
RUN apt-get install -y \
    python3.6 \
    python3-pip

ENV PYTHONUNBUFFERED 1
RUN mkdir /api
WORKDIR /api

COPY . /api/
RUN pip install pipenv
RUN ls
RUN pipenv sync
Run Code Online (Sandbox Code Playgroud)

我安装了 python 3.6 和 pip3 但得到

Step 9/11 : RUN pip install pipenv
 ---> Running in b184de4eb28e
/bin/sh: 1: pip: not found
Run Code Online (Sandbox Code Playgroud)

Mit*_*lin 7

pip为 python3运行,请使用pip3,而不是pip.