How do I install python on alpine linux? How do I install python on alpine linux? python python

How do I install python on alpine linux?


This is what I use in a Dockerfile for an alpine image:

# Install python/pipENV PYTHONUNBUFFERED=1RUN apk add --update --no-cache python3 && ln -sf python3 /usr/bin/pythonRUN python3 -m ensurepipRUN pip3 install --no-cache --upgrade pip setuptools


Look here: https://pkgs.alpinelinux.org/packagesSo what you are looking for are the python3 and py3-pip packages.

A suitable command to use inside a dockerfile/etc would be:

apk add --no-cache python3 py3-pip

Explanation of the --no-cache flag

Note however, that you need to add the community repository since py3-pip is not present on main.


instead of python3-pip install py3-pip

apk add --update python3 py3-pip