Skip to content

Instantly share code, notes, and snippets.

@mttmantovani
Created March 17, 2021 11:23
Show Gist options
  • Save mttmantovani/a8b820a9ccc673f6ec7265d234000635 to your computer and use it in GitHub Desktop.
Save mttmantovani/a8b820a9ccc673f6ec7265d234000635 to your computer and use it in GitHub Desktop.
Install pyenv on Ubuntu 20.04
#!/bin/bash
sudo apt-get install git python3-pip python-is-python3 make build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev curl libffi-dev
pip install virtualenvwrapper
git clone https://github.com/pyenv/pyenv.git ~/.pyenv
git clone https://github.com/pyenv/pyenv-virtualenv.git ~/.pyenv/plugins/pyenv-virtualenv
git clone https://github.com/pyenv/pyenv-virtualenvwrapper.git ~/.pyenv/plugins/pyenv-virtualenvwrapper
cat << EOF >> ~/.bashrc
export PYENV_ROOT="$HOME/.pyenv"
export PATH="$PYENV_ROOT/bin:$PATH"
if command -v pyenv 1>/dev/null 2>&1; then
eval "$(pyenv init -)"
fi
export PYENV_VIRTUALENVWRAPPER_PREFER_PYENV="true"
export WORKON_HOME=$HOME/.virtualenvs
eval "$(pyenv virtualenv-init -)"
pyenv virtualenvwrapper_lazy
EOF
exec $SHELL
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment