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

For Python3:

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

If you install python-pip for Python2 as well, you need to use pip3 for Python3 and pip for Python2. But with this setting, pip is the same as pip3. Check with pip -V.

Thats it 🙂

Leave a Comment