Skip to content

Instantly share code, notes, and snippets.

@kibernick
Forked from jmvrbanac/install_pyenv.sh
Last active June 12, 2019 11:39
Show Gist options
  • Save kibernick/8b4160197f78b469094333e0ce575d9d to your computer and use it in GitHub Desktop.
Save kibernick/8b4160197f78b469094333e0ce575d9d to your computer and use it in GitHub Desktop.
Install pyenv on Ubuntu
#!/bin/bash
sudo apt-get install git python-pip make build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev curl
if [ ! -d "~/.pyenv" ]; then
git clone https://github.com/pyenv/pyenv.git ~/.pyenv
fi
if [ ! -d "~/.pyenv/plugins/pyenv-virtualenv" ]; then
git clone https://github.com/pyenv/pyenv-virtualenv.git ~/.pyenv/plugins/pyenv-virtualenv
fi
read -p "Enter your shell init script to set up pyenv and plugins [.bashrc]: " name
shell_script=${name:-.bashrc}
echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/$shell_script
echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/$shell_script
echo 'eval "$(pyenv init -)"' >> ~/$shell_script
echo 'eval "$(pyenv virtualenv-init -)"' >> ~/$shell_script
exec $SHELL
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment