python3 and pip3 in docker

user10875974 picture user10875974 · Jan 16, 2019 · Viewed 15.8k times · Source

I want to use python 3.x and pip3 to install some python libraries in docker. I used following commands to do it, but they were not installed.

FROM alpine:latest

RUN apk add python3 py3-pip3 && \
pip3 install --upgrade pip3 && \
pip3 install wget &&\
pip3 install sys &&\
pip3 install threading &&\
pip3 install time &&\
pip3 install requests &&\
pip3 install paho-mqtt &&\
pip3 install logging &&\
rm -rf /var/cache/apk/*

COPY NumSide.py /home/mehdi/Download/NumSide.py

CMD ["python3","/home/mehdi/Download/NumSide.py"]

Below, the error I got:

ERROR: unsatisfiable constraints: py3-pip3 (missing): required by: world[py3-pip3] The command '/bin/sh -c apk add python3 py3-pip3 && pip3 install --upgrade pip3 && pip3 install wget &&pip3 install sys &&pip3 install threading &&pip3 install time &&pip3 install requests &&pip3 install paho.mqtt.client &&pip3 install logging &&rm -rf /var/cache/apk/*' returned a non-zero code: 1

Answer

stacksonstacks picture stacksonstacks · Sep 26, 2019

The package name is py3-pip not py3-pip3