helm/dev/+pyenv/install

25 lines
841 B
Plaintext
Raw Normal View History

#!/usr/bin/env bash
if [[ ! -d "$HOME/.pyenv" || $FORCE ]]; then
git clone https://github.com/yyuu/pyenv.git $HOME/.pyenv
# Install the latest v2 and v3 versions of python
source "$(cd $(dirname $0) && pwd)"/env.zsh
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."
fi