New AWS EC2 instances come with Python 3 pre-installed. Please execute the below command to check if Python 3 is already installed in your EC2 instance.
1 2 |
## Check python version python --version |
If Python 3 is not installed in your EC2 instance or you have a lower version of Python, execute the below command to install Python 3 in your EC2 instance.
1 2 3 4 5 6 7 8 |
## On Debian OS, such as Ubuntu, use APT. sudo apt-get install python3.7 ## On RHEL OS, such as CentOS, use yum sudo yum install python37 ## On Suse OS, use zypper. sudo zypper install python3-3.7 |