2016-12-23 16:49:09 -08:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
2017-04-27 10:39:33 -07:00
|
|
|
if [[ ! -d "$HOME/.pyenv" || $FORCE ]]; then
|
2016-12-23 16:49:09 -08:00
|
|
|
git clone https://github.com/yyuu/pyenv.git $HOME/.pyenv
|
2017-04-27 10:39:33 -07:00
|
|
|
|
|
|
|
# Install the latest v2 and v3 versions of python
|
2017-05-04 04:14:30 -07:00
|
|
|
PATH="$HOME/.pyenv/bin:$PATH"
|
2017-04-27 10:39:33 -07:00
|
|
|
py2=$(pyenv install --list | sed 's/^ //' | grep -e '^3' | grep --invert-match 'dev\|a\|b' | tail -1)
|
|
|
|
py3=$(pyenv install --list | sed 's/^ //' | grep -e '^2' | grep --invert-match 'dev\|a\|b' | tail -1)
|
|
|
|
pyenv install "$py2"
|
|
|
|
pyenv install "$py3"
|
|
|
|
pyenv global "$py3" "$py2"
|
|
|
|
|
|
|
|
# Install global packages
|
|
|
|
for pip in pip2 pip3; do
|
|
|
|
$pip install --upgrade pip
|
|
|
|
$pip install ipython setuptools numpy matplotlib PyQT5
|
|
|
|
done
|
|
|
|
|
|
|
|
# Install packages needed for dotfile scripts
|
|
|
|
pip3 install totp pytz tzlocal
|
|
|
|
else
|
|
|
|
>&2 echo "~/.pyenv already exists, can't install."
|
2016-12-23 16:49:09 -08:00
|
|
|
fi
|