25 lines
827 B
Bash
Executable file
25 lines
827 B
Bash
Executable file
#!/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
|
|
PATH="$HOME/.pyenv/bin:$PATH"
|
|
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
|