Skip to content

Instantly share code, notes, and snippets.

@tik0
Forked from mattseymour/build-instructions
Last active February 4, 2020 00:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tik0/6cbd5c99eea82fc325554a4a3de13ecb to your computer and use it in GitHub Desktop.
Save tik0/6cbd5c99eea82fc325554a4a3de13ecb to your computer and use it in GitHub Desktop.
Build Python 3.6 from source for Ubuntu and Debian
Prerequisties install:
- sudo apt-get install build-essential checkinstall
These are the dependancies required by python:
- sudo apt-get install libbz2-dev libc6-dev libgdbm-dev libncursesw5-dev libreadline-gplv2-dev libssl-dev libsqlite3-dev tk-dev
Download the tar source file from python.org (at the time of writing 3.6.1 is the latest release):
- wget -O ~/Downloads/python3.6.1.tgz https://www.python.org/ftp/python/3.6.1/Python-3.6.1.tgz
Via command line navigate to the downloaded file directory:
- cd ~/Downloads/
Untar the downloaded file:
- tar -zxvf python3.6.1.tgz
Via commandline navigate to the newly extracted file:
cd python3.6.1/
Compiling the code:
- ./configure --enable-optimizations
- sudo make altinstall
Altinstall will make sure default python on your machine is not touched.
You can run python3.6 from commandline via the command python3.6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment