Hello everyone! Welcome to protozoahost, In this article, I am going to describe the steps to configure and set up the python version on a  server.

Step 1. Configuring managed servers

In order to use the newer version of Python on the server where your files are uploaded, you need to compile python from the source code following the given steps.
  1.  Login to your account using SSH.
  2. Enter the following commands at the command prompt.
cd ~
wget https://www.python.org/ftp/python/3.8.0/Python-3.8.0.tgz
tar xvzf Python-3.8.0.tgz
cd Python-3.8.0
./configure --prefix=$HOME
make
make install
3. To use the new Compiled executable, configure your shell environment by  typing the following commands:
echo 'alias python3="/home/username/bin/python3.8"' >> ~/.bashrc
source ~/.bashrc

Put your username instead of /username in above command.

   4. Type the following command to check whether latest python version is updated or not.

python3 --version

Step 2. Install Virtualenv

In order to create virtual environments using latest installed Python version, you must first install the virtualenv program,  to do this, use the following commands
cd ~/bin
python3.8 -m pip install virtualenv
After you installed virtualenv, you can now create virtual environment by running the virtualenv program in the bin directory. For reference, virtual environment named testenv is created below by first command and activated by second command below.
~/bin/virtualenv testenv
source testenv/bin/activate

Step 3. Configuring unmanaged servers

Still, different repositories for your Linux distribution may contain an older version of Python. If you want to run a newer version of Python, you can compile it from the source code. Follow the given steps to do so.
  1. Log in to your account using SSH.
  2. As the root user, at the command prompt, type following commands:
cd ~ wget https://www.python.org/ftp/python/3.8.0/Python-3.8.0.tgz tar xvzf Python-3.8.0.tgz cd Python-3.8.0 ./configure make make install3. To configure the shell environment to use the new compiled executable, type the following commands. Replace executable_path with the path to the compiled Python executable for example – /usr/local/bin
echo 'alias python3="/executable_path/python3.8"' >> ~/.bashrc
source ~/.bashrc
4. To confirm the update version again, type the following command.
python3 --version


That's all, hope your issue is solved by now.