Skip to content

Instantly share code, notes, and snippets.

@dkrusky
Created April 11, 2017 18:57
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 dkrusky/636ba9bd296a354347d31add70a311e6 to your computer and use it in GitHub Desktop.
Save dkrusky/636ba9bd296a354347d31add70a311e6 to your computer and use it in GitHub Desktop.
Install specified version of Python from source on Debian 8
#!/bin/bash
if [ -z "$1" ]
then
echo "Syntax: install-python <version>"
echo "Example: install-python 3.6.1"
exit;
fi
apt-get install packaging-dev debian-keyring devscripts equivs python python-dev python3 python3-dev python3-pip libxml2-dev libacl1-dev direnv
wget https://www.python.org/ftp/python/$1/Python-$1.tgz
tar xvf Python-$1.tgz
cd Python-$1
./configure --enable-optimizations
make -j8
sudo make install
if [ "$(echo $1 | head -c 1)" == "3" ]
then
easy_install3 -U pip
exit;
fi
easy_install -U pip
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment