Skip to content

Instantly share code, notes, and snippets.

@tejashah88
Last active November 24, 2019 22:50
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 tejashah88/f6988fac21ece8c4dabcf767b43f92c1 to your computer and use it in GitHub Desktop.
Save tejashah88/f6988fac21ece8c4dabcf767b43f92c1 to your computer and use it in GitHub Desktop.
Install python 3 from scratch. Helpful for upgrading python 3 version in GCP's Deep Learning VM.
VERSION=$1
sudo apt install gcc make zlib1g-dev
sudo apt install libssl-dev # needed for SSL support
sudo apt install libsqlite3-dev # needed for SQLite support
sudo apt-get install libbz2-dev # needed for BZ2 compression support
wget "https://www.python.org/ftp/python/$VERSION/Python-$VERSION.tar.xz"
tar xJf "Python-$VERSION.tar.xz"
cd "Python-$VERSION"
./configure --enable-optimizations --enable-loadable-sqlite-extensions
sudo make
sudo make install
cd ..
sudo pip3 install --upgrade pip
python3 -V
pip3 -V
@tejashah88
Copy link
Author

Usage Instructions

install-python-scratch.sh 3.6.9

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment