In this post we are going to begin a series focused on Python. We are going to examine the theoretical foundations of Python, how code is run, and then into the actual building blocks and data types that we will have access to when writing programs.
We are going to begin by installing Python 3.7 on an AWS EC2 instance. Most of the work that we will complete will require root privileges so let’s begin with sudo -i to switch over to root.

Our next step will be to change our directory to /usr/src.

Please enter yum groupinstall -y “Development Tools” to install the development tools that will be needed for our work in Python.

Please enter yum install -y zlib-devel to install the final dependency needed for us to install Python 3.7.

Our next step will be to grab our source code. Please enter wget https://python.org/ftp/python/3.7.3/Python-3.7.3.tar.xz

We can see that the URL has been “Moved Permanently” in the above screenshot. This is why I choose to use wget instead of something like curl which will not follow redirects.
Unpack the package by entering tar xf Python-3.7.3.tar.xz

You will see that we now will have a Python directory.

CD into the Python directory with cd Python-3.7.3

Please enter ./configure –enable-optimizations –with-ensurepip=install

This command will generate the MakerFile so that we will be able to complete our installation with the make command.
Enter make altinstall. We use altinstall to avoid replacing the existing Python that is shipped with every Linux distribution.

It will take time for the build to complete. Please exit from root.

This completes our installation of Python 3.7.3.
Thank you for taking the time to visit cloudsecurityessentials.org. If these posts are beneficial to you then we ask that you consider sharing them with your friends and colleagues.