# docker run
docker run -it --rm amazonlinux:2 bash
In the container
yum update -y
# install
amazon-linux-extras install python3.8 -y
# install devel
# `amazon-linux-extras install python3.8`It is said to be no package until after
yum install -y python38-devel # /usr/include/python3.8
pip3.8 install --upgrade pip # `pip`, `pip3`Is 3.Become facing 8
pip install upgrade --setuptools
# run
python3.8
# venv
cd /tmp
python3.8 -m venv venv
source venv/bin/activate
Bonus (MySQL compatible, other than 3.8)
# 3.For when it is not 8
yum install -y python-devel # /usr/include/python2.7
yum install -y python3-devel # /usr/include/python3.7m
#For when you need it for MySQL operation
yum install -y gcc
yum install -y mysql-devel mysql-libs # /lib64/mysql/libmysqlclient.so.18 enters
Recommended Posts