2016-10-16 07:41:03 -05:00
|
|
|
#!/bin/bash
|
|
|
|
# this will install a local copy of python for the user
|
|
|
|
|
|
|
|
# change the version if you want a different version
|
|
|
|
# https://www.python.org/downloads/
|
|
|
|
|
|
|
|
py_version=2.7.12
|
|
|
|
download_url=https://www.python.org/ftp/python/2.7.12/Python-${py_version}.tar.xz
|
|
|
|
|
|
|
|
# download the python version and extract it
|
2016-10-16 09:14:40 -05:00
|
|
|
|
2016-10-16 07:41:03 -05:00
|
|
|
DOTFILES_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
|
|
|
mkdir -p "$DOTFILES_DIR/python"
|
|
|
|
cd "$DOTFILES_DIR/python"
|
|
|
|
wget $download_url
|
|
|
|
tar xvf Python-${py_version}.tar.xz
|
|
|
|
find "$DOTFILES_DIR/python" -type d -exec chmod 0755 {} \;
|
|
|
|
cd Python-${py_version}
|
|
|
|
|
|
|
|
|
|
|
|
# okay now install it
|
2016-10-16 09:14:40 -05:00
|
|
|
|
2016-10-16 07:41:03 -05:00
|
|
|
./configure --prefix=$DOTFILES_DIR/python
|
|
|
|
make
|
|
|
|
make install
|
|
|
|
|
|
|
|
# update the users $PATH variable to include the newly installed python binary
|
|
|
|
|
2016-10-16 08:31:52 -05:00
|
|
|
export PATH="$DOTFILES_DIR/python/bin:$PATH"
|
|
|
|
export PYTHONPATH="$DOTFILES_DIR/python/bin"
|