Skip to content

Instantly share code, notes, and snippets.

@neosergio
Forked from jmvrbanac/install_pyenv.sh
Created October 31, 2021 21:11
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save neosergio/3c876c37487cccc67ed09d1c79d347ed to your computer and use it in GitHub Desktop.
Save neosergio/3c876c37487cccc67ed09d1c79d347ed 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
sudo pip install virtualenvwrapper
git clone https://github.com/yyuu/pyenv.git ~/.pyenv
git clone https://github.com/yyuu/pyenv-virtualenvwrapper.git ~/.pyenv/plugins/pyenv-virtualenvwrapper
echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bashrc
echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bashrc
echo 'eval "$(pyenv init -)"' >> ~/.bashrc
echo 'pyenv virtualenvwrapper' >> ~/.bashrc
exec $SHELL
@neosergio
Copy link
Author

For Ubuntu 21.10, additional line:

sudo apt-get install python-is-python3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment