Skip to content

Instantly share code, notes, and snippets.

@barbietunnie
Created April 7, 2022 09:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save barbietunnie/1df3ec58578a16082831f76101b1c4dd to your computer and use it in GitHub Desktop.
Save barbietunnie/1df3ec58578a16082831f76101b1c4dd to your computer and use it in GitHub Desktop.
Setup `pyenv` in Ubuntu 20

Setup pyenv in Ubuntu 20

  1. Check if curl is installed:
curl --version

If it is not installed, install as follows:

sudo apt-get install curl
  1. Install pyenv:
curl https://pyenv.run | bash
  1. Update ~/.bashrc with the following information:
export PATH="~/.pyenv/bin:$PATH"
eval "$(pyenv init -)"
eval "$(pyenv virtualenv-init -)"
  1. Restart your shell so the path changes can take effect:
exec $SHELL

Updating

To update pyenv:

pyenv update

Uninstalling

To uninstall pyenv:

rm -rf ~/.pyenv

Remove the added entries from ~./bashrc

export PATH="$HOME/.pyenv/bin:$PATH"
eval "$(pyenv init --path)"
eval "$(pyenv virtualenv-init -)"

Restart shell

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