This blog post will show you how to install Python 3.8 on an Amazon Linux 2 EC2 Instance.
In my case, I have an Amazon Linux 2 EC2 instance that I have deployed, and by default, it comes with Python 2.7.
Amazon Linux 2
Amazon Linux 2 is a Linux-based operating system that is designed to run on virtual servers and cloud environments. It is a successor to Amazon Linux and comes with a variety of new features and improvements.
Some of the key features of Amazon Linux 2 include long-term support, enhanced security, improved performance, and compatibility with a wide range of software packages.
Additionally, it comes with a pre-installed set of tools and applications that are commonly used in cloud environments, making it easy to get started with.
Install Python 3.8 on Amazon Linux 2 EC2 Instance
To start the process, I will SSH to my instance and run the following command that will install all the dependencies.
yum install gcc openssl-devel bzip2-devel libffi-devel
Next, Check the Python website below for the latest build number.
https://www.python.org/downloads/source/
In my case, I will install the latest build, which is 3.8.1, and run the command below to download it.
sudo wget https://www.python.org/ftp/python/3.8.1/Python-3.8.1.tgz
I will go ahead and unzip the file.
sudo tar xzf Python-3.8.1.tgz
Next, open the directory
cd Python-3.8.1/
The two commands below will install the files.
sudo ./configure --enable-optimizations
sudo make altinstall
To run Python 3.8, type
python3.8
Comments
One response to “Install Python 3.8 on Amazon Linux 2 EC2 Instance”
Or : amazon-linux-extras enable python38 ; yum -y install python38