Put Python3 in Docker container of Amazon Linux2

# 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

Put Python3 in Docker container of Amazon Linux2
Until you put Python in Docker
Put only kubectl in Amazon Linux 2
Use python in Docker container as Pycharm interpreter
Addition of amazon linux swap
Equivalence of objects in Python
Put jenv on Amazon Linux
Implementation of quicksort in Python
Run Amazon Linux 2 in VirtualBox
Put the latest version of Python on linux (Debian) on Chromebook
How to implement Python EXE for Windows in Docker container
Put Ubuntu in Raspi, put Docker on it, and control GPIO with python from the container
Install Python Pillow on Amazon Linux
Pixel manipulation of images in Python
Put MeCab in "Windows 10; Python3.5 (64bit)"
Create a DI Container in Python
Python is UnicodeEncodeError in CodeBox docker
Division of timedelta in Python 2.7 series
MySQL-automatic escape of parameters in python
Completion of docker command on Linux
Install tensorflow in Docker (LINUX) (memo)
Implementation of life game in Python
Waveform display of audio in Python
Law of large numbers in python
Implementation of original sorting in Python
Reversible scrambling of integers in Python
Introduce Python 3.5.2 environment on Amazon Linux
Create a Docker container image with JRE8 / JDK8 on Amazon Linux
I put Python 2.7 in Sakura VPS 1GB.
Conversion of string <-> date (date, datetime) in Python
Create your own Linux commands in Python
Building a Python3 environment with Amazon Linux2
[Understanding in 3 minutes] The beginning of Linux
Check the behavior of destructor in Python
(Bad) practice of using this in Python
General Theory of Relativity in Python: Introduction
Using venv in Windows + Docker environment [Python]
Find files like find on linux in Python
[Linux] List of Linux commands used in practice
Display a list of alphabets in Python 3
Comparison of Japanese conversion module in Python3
[Itertools.permutations] How to put permutations in Python
PUT gzip directly to S3 in Python
[Bash / linux] Notes in case of trouble
[FX] Hit oanda-API in Python using Docker
Summary of various for statements in Python
[Python] How to put any number of standard inputs in a list
The result of installing python in Anaconda
I put Linux (Ubuntu) in VAIO SX14.
Gang of Four (GoF) Patterns in Python
The basics of running NoxPlayer in Python
Bulk replacement of strings in Python arrays
Project Euler # 16 "Sum of Powers" in Python
Run a batch of Python 2.7 with nohup on Amazon Linux AMI on EC2
Run Keycloak on Amazon Linux 2 without Docker
Traffic Safety-kun: Recognition of traffic signs in Python
Summary of built-in methods in Python list
Non-logical operator usage of or in python
In search of the fastest FizzBuzz in Python
Practical example of Hexagonal Architecture in Python
[Amazon Linux] Switching from Python 2 series to Python 3 series