Python is a powerful programming language. It is very friendly and easy to learn. During the latest update of this article Python 3.9 latest stable version is available to download and install.
This tutorial will help you to install Python 3.9 on Amazon Linux systems.
- Use the following command to install prerequisites for Python before installing it.
sudo yum install gcc openssl-devel bzip2-devel libffi-devel
- Create a new folder
Go to inside opt folder
- Now you can use the following command to download Python 3.9.0 on a local machine.
sudo wget https://www.python.org/ftp/python/3.9.0/Python-3.9.0.tgz
- Now extract the downloaded package.
sudo tar xzf Python-3.9.0.tgz
- Use the below set of commands to compile Python 3.9 from the source code and install using the altinstall command.
$ cd Python-3.9.0
$ sudo ./configure
$ sudo make altinstall
- Now remove the downloaded source archive file from your system
sudo rm -f /opt/Python-3.9.0.tgz
Check Python Version:
Check if python3.9 installed correctly by checking its version. Use command python3.9 instead of python. The new binary will be installed at /usr/local/bin/python3.9 location.