Hi Python 3.8.

Here is 钿钿
I'm here to share how to install Python 3.8.1 with Ubuntu 16.04 LTS.

0. Start

At first, I just want to build a server for remote. I've tried Windows server 2019, but I can't active it with colleage KMS. So there is a strange Ubuntu server come out.

However, system comes with Python 2.7.2 and 3.5.2, which I'm plan to update it.

1. Ready

First of all, PLEASE update your apt source list:

sudo apt-get update
sudo apt-get upgrade

For somehow, there is some optional applications for build, I prefer to use them:

  • Aria2: For faster download
    sudo apt-get install aria2

Let's start with download source code

Download from python.org

aria2c -x 8 https://www.python.org/ftp/python/3.8.1/Python-3.8.1.tgz

or

wget https://www.python.org/ftp/python/3.8.1/Python-3.8.1.tgz

Install requirement

For this part, follow may not completly, please install additional with error message.

sudo apt-get install build-essential zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev libssl-dev libreadline-dev libffi-dev

2. Install

After download Python-3.8.1.tgz, you can install now!

a. Unzip file

tar -xvf Python-3.8.1.tgz

b. Change folder

cd Python-3.8.1.tgz

c. Generate makeFile

./configure

d. Make

# j is process thread, big is better(depends on your CPU )
sudo make -j4

e. Install to bin

sudo make install

Then you will get Python 3.8.1

3. Pypi go!

Here is a simple guide for install Pypi with mutiple version Python.

  • For Python 2.7:
    wget https://bootstrap.pypa.io/get-pip.py
    sudo python get-pip.py
  • For Python 3.8:
    sudo apt-get install python3-pip
    sudo ln -s /usr/local/bin/pip3.8 /usr/local/bin/pip3

PLZ DO NOT USE PSM. This will mix up Pip3 & Pip source