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 ]
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/
Discussions

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
Problem Building Python 3.7.0 in Amazon Linux 2
Maybe try pyenv . It builds any Python version for you. Before building make sure you have installed all build dependencies . Using pyenv-virtualenv you can activate the Python version for your virtual environment. More on reddit.com
🌐 r/aws
9
8
August 21, 2018
Python 3.8 in EC2
Install pyenv… More on reddit.com
🌐 r/aws
12
0
October 15, 2023
🌐
AWS
docs.aws.amazon.com › amazon linux › user guide › getting started with programming runtimes on al2023 › python in al2023
Python in AL2023 - Amazon Linux 2023
May 22, 2026 - AL2023 removed Python 2.7 and any components requiring Python are now written to work with Python 3.
🌐
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 - In a nutshell, to install Python and Pip on Amazon Linux 2, run sudo yum update -y and yum install python3 -y. To install Python and Pip on Ubuntu on an EC2 instance, run sudo apt update and sudo apt install python3 python3-pip -y. Let's dive ...
🌐
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.
🌐
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.
Find elsewhere
🌐
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.
🌐
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.
🌐
Reddit
reddit.com › r/aws › amazon linux 2 python incompatibility woes
r/aws on Reddit: Amazon Linux 2 Python incompatibility woes
September 14, 2023 -

A customer wants to continue to use Amazon Linux 2, I'm wanting to package some Python software for them, to be delivered via RPM.

Some dependencies are available in EPEL, and I used the Amazon instructions to install and enable that repo.

Using amazon-linux-extras installs Python 3.7, but nearly everything we need is in EPEL which is set for Python 3.6. So we insist on installing Python 3.6 from EPEL instead.

This makes we wonder how anyone is getting any work done with the Amazon Linux 2 image? Or am I doing something wrong? Is everyone just installing everything from source or using pip? The RPM packaging system appears in conflict with itself out of the box.

🌐
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 ...
🌐
GitHub
gist.github.com › skatsuta › b062b46f687c3bee765026648c1e031e
Install Python 3.6 in Amazon Linux 2 · GitHub
Install Python 3.6 in Amazon Linux 2. GitHub Gist: instantly share code, notes, and snippets.
🌐
Jennas-lee
jennas-lee.github.io › aws-resources-example › General › 02-install-python-311
Install Python 3.11 - AWS Resources Example
OpenSSL Python · Amazon Linux 2/CentOS 7Ubuntu · sudo yum update -y sudo yum install -y zlib zlib-devel libffi libffi-devel bzip2 bzip2-devel gcc make sudo yum remove -y openssl openssl-devel wget https://www.openssl.org/source/openssl-1.1.1q.tar.gz tar -xvzf openssl-1.1.1q.tar.gz cd openssl-1.1.1q ./config sudo make sudo make install sudo ln -s /usr/local/bin/openssl /usr/bin/openssl sudo cp libssl.so.1.1 /usr/lib64/libssl.so.1.1 sudo cp libcrypto.so.1.1 /usr/lib64/libcrypto.so.1.1 openssl version cd wget https://www.python.org/ftp/python/3.11.4/Python-3.11.4.tgz tar -xvzf Python-3.11.4.tgz cd Python-3.11.4 ./configure sudo make sudo make install ln -s /usr/local/bin/python3 /usr/bin/python3 python3 --version pip3 --version ·
🌐
ComputingForGeeks
computingforgeeks.com › home › how to install python 3.13 on amazon linux 2
How To Install Python 3.13 on Amazon Linux 2 [Guide]
March 16, 2026 - 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.
🌐
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.
🌐
PyPI
pypi.org › project › pandas
pandas · PyPI
The following attestation bundles were made for pandas-3.0.3-cp314-cp314t-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl:
      » pip install pandas
    
Published   May 11, 2026
Version   3.0.3
🌐
AWS re:Post
repost.aws › knowledge-center › ec2-linux-python3-boto3
Create a Python 3 environment with the Boto 3 library on Amazon Linux 2 | AWS re:Post
June 24, 2025 - To make sure that your environment has the latest pip module installed, run the following command: ... (env) [ec2-user ~]$ python Python 3.7.4 (default, Dec 13 2019, 01:02:18)[GCC 7.3.1 20180712 (Red Hat 7.3.1-6)] on linux Type "help", "copyright", "credits" or "license" for more information. >>>> To import the Boto3 library and confirm that it works, run the following command: ... The following example output lists all the Amazon Simple Storage Service (Amazon S3) buckets within the AWS account:
🌐
Medium
medium.com › @shanmorton › install-python-and-boto3-on-an-aws-ec2-instance-e8e40d92160f
Install python and boto3 on an AWS EC2 instance. | by Shandra Morton | Medium
October 13, 2020 - At the EC2 management console, spin up an Amazon Linux 2 AMI instance, t2.micro is OK and take the defaults. Also make sure that if you’re going to use a key pair to launch the instance, that you have that handy!