Skip to content

Instantly share code, notes, and snippets.

@mdiener21
Created November 4, 2015 13:20
Show Gist options
  • Save mdiener21/85e9789b5fb565a9f1da to your computer and use it in GitHub Desktop.
Save mdiener21/85e9789b5fb565a9f1da to your computer and use it in GitHub Desktop.
install python 3.4.3 on ubuntu 12.04 server
## Common Packages
# ---------------
sudo apt-get -y update
sudo apt-get -y upgrade
sudo apt-get -y install software-properties-common libssl-dev openssl wget
## Install latest Python 3
# -----------------------
PY_VERSION=3.4.3
PY_URL="https://www.python.org/ftp/python/$PY_VERSION/Python-$PY_VERSION.tgz"
PY_DIR="Python-$PY_VERSION"
# Run these cmd in /opt
cd $HOME
# Download Python
wget "$PY_URL"
# Extract it
sudo tar -xvf "$PY_DIR.tgz" -C /opt && rm -f "$PY_DIR.tgz"
# Link the headers
sudo ln -s "/opt/$PY_DIR/Include" /usr/include/python3.4
# Change to the directory
cd "/opt/$PY_DIR"
# Configure and make
./configure && make
# Install it
sudo make install
echo 'alias python3="/opt/python3.4.3/bin/python3.4.3"' >> .bashrc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment