Skip to content

Instantly share code, notes, and snippets.

@sgtoj
Created March 6, 2018 12:17
Show Gist options
  • Save sgtoj/2a2d05c05c7dd35a957b479fb2c4dfe3 to your computer and use it in GitHub Desktop.
Save sgtoj/2a2d05c05c7dd35a957b479fb2c4dfe3 to your computer and use it in GitHub Desktop.
Install Python 3.6 from Source for Windows for Ubuntu

Python 3.6 is not avaliable via apt-get using a trusted source for the WSL's current version of Ubuntu (v16.04). Therefore, it is recommended to install Python 3.6 from source using the steps below. Be warned, installing Python from source takes several minutes to complete.

sudo apt-get install -y build-essential checkinstall
sudo apt-get install -y libreadline-gplv2-dev libncursesw5-dev libssl-dev libsqlite3-dev tk-dev libgdbm-dev libc6-dev libbz2-dev
cd /usr/src
sudo wget https://www.python.org/ftp/python/3.6.2/Python-3.6.2.tgz
sudo tar xzf Python-3.6.2.tgz
cd Python-3.6.2
sudo ./configure
sudo make altinstall
cd ~
sudo ln -sf /usr/local/bin/python3.6 /usr/bin/python
python -m pip install --upgrade pip
sudo rm -rf /usr/src/Python*
python --version
python -m pip --version
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment