Skip to content

Instantly share code, notes, and snippets.

@gdevanla
Created June 27, 2018 02:20
Show Gist options
  • Save gdevanla/d37c1266c9c321775c73440cee41be8a to your computer and use it in GitHub Desktop.
Save gdevanla/d37c1266c9c321775c73440cee41be8a to your computer and use it in GitHub Desktop.
Install Python 3.6.5 in Ubuntu 16+
#!/bin/bash
export PYTHON_VERSION=3.6.5
export PYTHON_DOWNLOAD_URL=https://www.python.org/ftp/python/$PYTHON_VERSION/Python-$PYTHON_VERSION.tgz
sudo apt update
sudo apt install --no-install-recommends -y \
software-properties-common build-essential \
libssl-dev libreadline-dev libbz2-dev libsqlite3-dev zlib1g-dev \
python-minimal
cd ~/Downloads
wget "$PYTHON_DOWNLOAD_URL" -O python.tar.tgz
tar -zxvf python.tar.tgz
cd Python-$PYTHON_VERSION
./configure --enable-optimizations --enable-loadable-sqlite-extensions
make
sudo make install
cd ..
sudo rm -rf Python-$PYTHON_VERSION
alias python=python3
alias pip=pip3
pip install --upgrade pip
python --version
pip --version
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment