If you do a

Copysudo yum list | grep python3

you will see that while they don't have a "python3" package, they do have a "python34" package, or a more recent release, such as "python36". Installing it is as easy as:

Copysudo yum install python34 python34-pip
Answer from TaborKelly on Stack Overflow
Top answer
1 of 14
321

If you do a

Copysudo yum list | grep python3

you will see that while they don't have a "python3" package, they do have a "python34" package, or a more recent release, such as "python36". Installing it is as easy as:

Copysudo yum install python34 python34-pip
2 of 14
86

Note: This may be obsolete for current versions of Amazon Linux 2 since late 2018 (see comments), you can now directly install it via yum install python3.

In Amazon Linux 2, there isn't a python3[4-6] in the default yum repos, instead there's the Amazon Extras Library.

Copysudo amazon-linux-extras install python3

If you want to set up isolated virtual environments with it; using yum install'd virtualenv tools don't seem to reliably work.

Copyvirtualenv --python=python3 my_venv

Calling the venv module/tool is less finicky, and you could double check it's what you want/expect with python3 --version beforehand.

Copypython3 -m venv my_venv

Other things it can install (versions as of 18 Jan 18):

Copy[ec2-user@x ~]$ amazon-linux-extras list
  0  ansible2   disabled  [ =2.4.2 ]
  1  emacs   disabled  [ =25.3 ]
  2  memcached1.5   disabled  [ =1.5.1 ]
  3  nginx1.12   disabled  [ =1.12.2 ]
  4  postgresql9.6   disabled  [ =9.6.6 ]
  5  python3=latest  enabled  [ =3.6.2 ]
  6  redis4.0   disabled  [ =4.0.5 ]
  7  R3.4   disabled  [ =3.4.3 ]
  8  rust1   disabled  [ =1.22.1 ]
  9  vim   disabled  [ =8.0 ]
 10  golang1.9   disabled  [ =1.9.2 ]
 11  ruby2.4   disabled  [ =2.4.2 ]
 12  nano   disabled  [ =2.9.1 ]
 13  php7.2   disabled  [ =7.2.0 ]
 14  lamp-mariadb10.2-php7.2   disabled  [ =10.2.10_7.2.0 ]
🌐
Medium
medium.com › @phueb › installing-python-3-10-on-amazon-linux-2-dc2537ea9f4b
Installing Python 3.10 on Amazon Linux 2 | by Philip Huebner | Medium
January 2, 2024 - This tutorial guides you through the process of installing Python 3.10 on an Amazon Linux 2 instance.
Discussions

Python 3.10+ on EC2 running Amazon Linux 2, and the openssl upgrade requirement.
The reason to upgrade was driven ... Linux 2 distribution, will go with it. If 3.10+ is required, will explore other options like Lambda. ... If you want to avoid compiling and is fine with older version, python 3.8 is available from amazon-linux-extras You will need to remove python 3.7 first. Possible commands as below · # python3 --version Python 3.7.16 # sudo yum remove python3 # amazon-linux-extras | grep python 36 python3.8 available [ =stable ] # sudo amazon-linux-extras install python3.8 ... More on repost.aws
🌐 repost.aws
2
0
August 31, 2023
How can I get Python 3.10+ on an EC2 instance
I would look into packer, you can ... with all your software installed. ... Amazon researchers are reportedly behind the jailbreak report that led to the U.S. crackdown on Anthropic’s top models. ... Updating Python 2 to Python 3 on Amazon Linux instance.... More on reddit.com
🌐 r/aws
14
0
January 7, 2024
Amazon Linux 2 Python incompatibility woes
I didn’t have any issue with 3.9 and epel on al2. But I rarely use it. As someone else said pyenv or i generally take it a step further and just use docker since all of our stuff is already set up to easily run a container anywhere. I am generally so over touching python in the host os at all, or php, or really anything. Having to depend on their repos and all of that. No thanks. Take a few minutes and just forget what your host os is and containerize it where you will never again have those issues. I personally start with alpine but there are some good official and updated bases you can use to get you a full python environment on alpine in seconds. And customize anything else you need. That also makes sure if you ever change a host os that doesn’t have the same default modules installed you don’t even have to care. I would say forget packaging your software with rpm and go docker. Same concept. You publish a repo and version and all that. It just doesn’t have to care about the host os. At all (well, mostly ;)) More on reddit.com
🌐 r/aws
12
13
September 14, 2023
Updating Python 2 to Python 3 on Amazon Linux instance. Getting `No package available / Error: Nothing to do.`

Use amazon-linux-extras https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/amazon-linux-ami-basics.html#extras-library

More on reddit.com
🌐 r/linuxquestions
4
1
November 15, 2021
🌐
AWS
docs.aws.amazon.com › amazon linux › user guide › getting started with programming runtimes › python in al2
Python in AL2 - Amazon Linux 2
AL2 provides support and security patches for Python 2.7 until June 2026, as part of our long-term support commitment for AL2 core packages. This support extends beyond the upstream Python community declaration of Python 2.7 EOL of January 2020.
🌐
GitHub
gist.github.com › CoffieldWeb › dfac9b6600700be8623b49f2aae23db5
Install Python 3, Pip 3, and Virtualenv in AWS Amazon Linux 2 · GitHub
Install Python 3, Pip 3, and Virtualenv in AWS Amazon Linux 2 · Raw · python_3_aws.md · sudo yum update · sudo yum install python3 pip3 · sudo pip3 install virtualenv · virtualenv your_project_name · virtualenv -p /usr/bin/python ...
🌐
DEV Community
dev.to › aws-builders › easily-install-python-3-and-pip-on-an-ec2-instance-4goo
Install Python 3 and Pip on Amazon EC2 (Amazon Linux + Ubuntu) - DEV Community
April 2, 2026 - If you're using Amazon Linux 2, follow these steps: Update the Package List: Run sudo yum update -y to ensure that all existing packages are up to date. Install Python 3: Execute sudo yum install python3 -y to install Python 3.
🌐
All Things Data
newbiedba.wordpress.com › 2024 › 08 › 07 › installing-python-3-11-9-on-amazon-linux-2-al2
Installing Python 3.11.9 on Amazon Linux 2 (AL2)
August 7, 2024 - yum -y groupinstall "Development Tools" yum -y install gcc devel libffi-devel openssl11-1.1.1g openssl11-libs-1.1.1g openssl11-devel-1.1.1g yum -y install wget wget https://www.python.org/ftp/python/3.11.9/Python-3.11.9.tgz tar zxvf Python-3.11.9.tgz cd Python-3.11.9/ ./configure --enable-optimizations make make altinstall · Reference: 1. https://alas.aws.amazon.com/AL2/ALAS-2023-1934.html 2.
🌐
TecAdmin
tecadmin.net › how-to-install-python-3-11-on-amazon-linux-2
How to Install Python 3.11 on Amazon Linux 2 – TecAdmin
April 26, 2025 - So must have installed the required development libraries first. Open a terminal on your system and install the required packages with the following command: sudo yum install gcc openssl-devel bzip2-devel libffi-devel zlib-devel -y · Read: How to Use SSH to Connect Remote Linux Server
Find elsewhere
🌐
CloudSpinx
cloudspinx.com › home › how to › how to install python 3.13 on amazon linux 2
How To Install Python 3.13 on Amazon Linux 2 - CloudSpinx
June 4, 2025 - Before we dive into the crux of this guide, we need to have our Amazon Linux 2 system updated and the required tools installed. sudo yum update -y sudo yum groupinstall "Development Tools" -y sudo yum erase openssl-devel -y sudo yum install openssl11 openssl11-devel libffi-devel bzip2-devel wget -y · Since we are going to install Python 3.13 on Amazon Linux 2 by building it from the source, the above dependencies are necessary.
Top answer
1 of 2
3
Guess you are concerned that Python 3.7 EOL June this year If you want to avoid compiling and is fine with older version, python 3.8 is available from amazon-linux-extras You will need to remove python 3.7 first. Possible commands as below ``` # python3 --version Python 3.7.16 # sudo yum remove python3 # amazon-linux-extras | grep python 36 python3.8 available [ =stable ] # sudo amazon-linux-extras install python3.8 # rpm -ql python38 /usr/bin/pydoc3.8 /usr/bin/python3.8 /usr/share/doc/python38-3.8.16 /usr/share/doc/python38-3.8.16/README.rst /usr/share/man/man1/python3.8.1.gz # python3.8 --version Python 3.8.16 # sudo ln -s /usr/bin/python3.8 /usr/bin/python3 # sudo ln -s /usr/bin/pydoc3.8 /usr/bin/pydoc # python3 --version Python 3.8.16 ```
2 of 2
0
Hello, The latest stable version of Python available for Amazon Linux 2 AMI is 3.8 and you may install it using the amazon-linux-extras library. [+] Extras library (Amazon Linux 2) - https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/amazon-linux-ami-basics.html#extras-library Regarding OpenSSL, Amazon Linux 2 comes with OpenSSL 1.0.2 by default. [+] https://docs.aws.amazon.com/linux/al2023/ug/compare-with-al2.html Any security concerns and CVE’s regarding OpenSSL could be found in the document below : https://alas.aws.amazon.com/alas2.html In order to apply the security updates for OpenSSL, you may run the “yum update openssl” command on the instance. Additionally, you may keep an eye on the documents below for information about the upcoming features and announcements to services in order to check for the availability of the latest versions of the above packages in Amazon Linux 2 : - What’s New - https://aws.amazon.com/new/ - AWS Blog - https://aws.amazon.com/blogs/aws/ Further, you may manually install the required Python version (Python 3.10) from the official Python download page and configure it on your instance. Please find below a third-party article that I hope would be helpful to you : https://techviewleo.com/how-to-install-python-on-amazon-linux-2/
🌐
H. Kamran
hkamran.com › articles › installing a newer version of python on amazon ec2
Installing a Newer Version of Python on Amazon EC2 | H. Kamran
May 3, 2023 - sudo yum groupinstall "Development Tools" sudo yum install libffi-devel bzip2-devel · One more dependency is needed: OpenSSL. The openssl-devel package included in the repositories with Amazon Linux 2 is 1.0.7, but Python 3 currently requires 1.1.1 or newer.
🌐
Reddit
reddit.com › r/aws › how can i get python 3.10+ on an ec2 instance
r/aws on Reddit: How can I get Python 3.10+ on an EC2 instance
January 7, 2024 - I would look into packer, you can create your own AMIs. This will allow you to create an AMI with all your software installed. ... Amazon researchers are reportedly behind the jailbreak report that led to the U.S. crackdown on Anthropic’s top models. ... Updating Python 2 to Python 3 on Amazon Linux instance.
🌐
TecAdmin
tecadmin.net › install-python-3-9-on-amazon-linux
How to Install Python 3.9 on Amazon Linux 2 – TecAdmin
April 26, 2025 - In this tutorial, we will walk you through the process of installing Python 3.9 on Amazon Linux 2 systems using the source archive file.
🌐
Medium
computingpost.medium.com › how-to-install-python-3-10-on-amazon-linux-2-43ddcd511784
How To Install Python 3.10 on Amazon Linux 2 | by ComputingPost | Medium
October 23, 2022 - Before we dive into the crux of this guide, we need to have our Amazon Linux 2 system updated and the required tools installed. sudo yum update -y sudo yum groupinstall "Development Tools" -y sudo yum erase openssl-devel -y sudo yum install openssl11 openssl11-devel libffi-devel bzip2-devel wget -y · Since we are going to install Python 3.10 on Amazon Linux 2 by building it from the source, the above dependencies are necessary.
🌐
Medium
medium.com › pythoneers › installing-python-3-on-amazon-linux-with-openssl-and-pip-dependencies-2e9c76b91018
Installing Python 3 on Amazon Linux with OpenSSL and Pip Dependencies | by Rihem Larbi | The Pythoneers | Medium
July 22, 2024 - $ cd Python-3.12.2 $ sudo ./configure --with-openssl=/path/to/openssl11 $ sudo ./configure --enable-optimizations · PS: to get the path for openssl (“/path/to/openssl11”) you should run this command. ... Then you should compile the source and compile source as bellow. ... To simpify the installation and management of python packages you should install pip.
🌐
DEV Community
dev.to › bhaktraj › how-to-compile-and-install-python-312-on-amazon-linux-2-lcg
How to Compile and Install Python 3.12+ on Amazon Linux 2 - DEV Community
January 3, 2026 - # --enable-optimizations: improves ... --with-ensurepip=install make -j $(nproc) sudo make altinstall # Compile and install Python using 'make altinstall'. sudo make altinstall /usr/local/bin/python3.12 --version /usr/local/...
🌐
GitHub
gist.github.com › Sunlighter › 87bbd2cd80971c7c0d4763ec1b5ea548
Installing Python 3.7 in Amazon Linux 2 - Gist - GitHub
Start Amazon Linux 2 and sign in. (I recommend a c5.large instance.) Get the source tarball. wget https://www.python.org/ftp/python/3.7.0/Python-3.7.0.tar.xz · Uncompress it. ... Get Prerequisites. sudo yum install gcc bzip2-devel ncurses-devel ...
🌐
ComputingForGeeks
computingforgeeks.com › home › dev › how to install python 3.9 on amazon linux 2
How To Install Python 3.9 on Amazon Linux 2 | ComputingForGeeks
August 9, 2023 - $ make --version GNU Make 3.82 Built for x86_64-koji-linux-gnu Copyright (C) 2010 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. ... $ /usr/local/bin/python3.9 -m pip install --upgrade pip Defaulting to user installation because normal site-packages is not writeable Requirement already satisfied: pip in /usr/local/lib/python3.9/site-packages (21.2.4) Collecting pip Downloading pip-21.3.1-py3-none-any.whl (1.7 MB) |████████████████████████████████| 1.7 MB 11.1 MB/s Installing collected packages: pip Successfully installed pip-21.3.1
🌐
DEV Community
dev.to › hkamran › installing-a-newer-version-of-python-on-amazon-ec2-1b4n
Installing a Newer Version of Python on Amazon EC2 - DEV Community
May 3, 2023 - sudo yum groupinstall "Development Tools" sudo yum install libffi-devel bzip2-devel · One more dependency is needed: OpenSSL. The openssl-devel package included in the repositories with Amazon Linux 2 is 1.0.7, but Python 3 currently requires 1.1.1 or newer.