python3 command not found - Amazon Linux

Page content

How to Install Python3 Command on Amazon Linux

If you are using Amazon Linux and find that the python3 command is not available, do not worry. Here’s a step-by-step guide on how to install Python3 on Amazon Linux.

Why Python3 Command is Not Found?

Amazon Linux, by default, may not come with Python3 pre-installed. Python3 is a programming language widely used for various tasks, and having it available on your system is essential for running Python scripts and applications.

Installation Steps

  1. Update the package repository by running the following command:

    sudo yum update
    
  2. Install Python3 by running the following command:

    sudo yum install python3
    
  3. Verify the installation by checking the Python version:

    python3 --version
    
  4. Once installed, you can start using the python3 command to run Python scripts and applications.

Compatibility Note

If the yum package manager is not available on your Amazon Linux instance, you can use amazon-linux-extras to enable the Python3 package. Here’s how:

  1. Install amazon-linux-extras by running:

    sudo yum install amazon-linux-extras
    
  2. Enable the python3 package by running:

    sudo amazon-linux-extras enable python3
    
  3. Install Python3 using yum:

    sudo yum install python3
    
  4. Verify the installation with python3 --version.

By following these steps, you can ensure that Python3 is successfully installed and available on your Amazon Linux system.

Conclusion

Installing the python3 command on Amazon Linux is a straightforward process that ensures you have access to the Python3 interpreter, allowing you to run Python scripts and applications seamlessly. Be sure to follow the steps provided to set up Python3 on your Amazon Linux instance effectively.