Matt Seymour

To build Python3 from source for Ubuntu or Debain is relatively simple; so long as you have installed the required prerequisites. Listed below are packages which will be required for a successful build:

sudo apt-get install -y make build-essential curl libssl-dev libbz2-dev zlib1g-dev libreadline-dev libsqlite3-dev llvm libncurses5-dev libncursesw5-dev tk-dev wget xz-utils

To build python you can follow the instructions as listed in the official python documentation (make sure you read them carefully and use make altinstall. Another and sometimes easier option is to use pyenvwhich is a version manager for python installations (