You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
sudo apt-get install build-essential checkinstall
sudo apt-get install libreadline-gplv2-dev libncursesw5-dev libssl-dev \
libsqlite3-dev tk-dev libgdbm-dev libc6-dev libbz2-dev libffi-dev zlib1g-dev
cd /opt
sudo wget https://www.python.org/ftp/python/3.8.2/Python-3.8.2.tgz
sudo tar xzf Python-3.8.2.tgz
cd Python-3.8.2
sudo ./configure --enable-optimizations
sudo make altinstall
# check if success
python3.8 -V
cd /opt
sudo rm -f Python-3.8.2.tgz
Python 3.8.2 Installation (AMAZON LINUX optional)
Step 1 – Prerequaities
This Python installation required the GCC compiler on your system. Login to your server using ssh or shell access. Now, use the following command to install prerequisites for Python before installing it.
Read: How to Use SSH to Connect Remote Linux Server
Step 2 – Download Python 3.8
Download the Python from the Python official website. You can also download the latest version in place of specified below.
cd /opt
sudo wget https://www.python.org/ftp/python/3.8.2/Python-3.8.2.tgz
sudo tar xzf Python-3.8.2.tgz
Step 3 – Install Python 3.8
Use the below set of commands to compile Python 3.8 from the source code and install using the altinstall command.
cd Python-3.8.2
sudo ./configure --enable-optimizations
sudo make altinstall
make altinstall is used to prevent replacing the default python binary file /usr/bin/python.
Now remove downloaded source archive file from your system
sudo rm -f /opt/Python-3.8.2.tgz
Step 4 – Check Python Version
The Python 3.8 binary is installed under /usr/local/bin directory. As we have not overwritten the current Python version, you need to run Python 3.8 command as following: