In this tutorial, we will show you how to install and configuration Python 3 on Debian 8 server. For those of you who didn’t know, Python is an open-source and beginner-friendly programming language. Debian 7 and Debian 8 come with two versions of Python, Python 2.7 and Python 3.5. At the time of this writing, the latest stable version of Python is 3.6, released on Mar 21rd, 2017. If you need to use python 3 as part of Python application dependency, there are several ways to install python3 on Debian 8.
This article assumes you have at least basic knowledge of Linux, know how to use the shell, and most importantly, you host your site on your own VPS. The installation is quite simple and assumes you are running in the root account, if not you may need to add ‘sudo’ to the commands to get root privileges. I will show you through the step by step installation Python 3 on a Debian 8 (Jessie) server.
Install Python 3 on Debian 8 Jessie
Step 1. Before we install any software, it’s important to make sure your system is up to date by running these following apt-get commands in the terminal:
apt-get update apt-get upgrade
Step 2. Installing Python 3.
First, we need to install some build dependencies using the commands below:
sudo apt install build-essential checkinstall sudo apt install libreadline-gplv2-dev libncursesw5-dev libssl-dev libsqlite3-dev tk-dev libgdbm-dev libc6-dev libbz2-dev
Then, download Python 3.6 from source:
wget https://www.python.org/ftp/python/3.6.1/Python-3.6.1.tar.xz tar xvf Python-3.6.1.tar.xz
Now cd into the source directory, configure the built environment, and install:
cd Python-3.6.1/ ./configure sudo make altinstall
Once the process is complete, check the version of Python 3:
Congratulations! You have successfully installed Python. Thanks for using this tutorial for installing Python 3 on your Debian 8 system. For additional help or useful information, we recommend you to check the official Python website.