Skip to content

Instantly share code, notes, and snippets.

@jossef
Created January 24, 2023 08:16
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 jossef/bcc1fe00c3bd9de057beb545550a0d45 to your computer and use it in GitHub Desktop.
Save jossef/bcc1fe00c3bd9de057beb545550a0d45 to your computer and use it in GitHub Desktop.
Install python via pyenv on ubuntu 20.04

Install debian dependencies

sudo apt-get install aria2 build-essential curl git libbz2-dev libffi-dev liblzma-dev libncurses5-dev libncursesw5-dev libreadline-dev libsqlite3-dev libssl-dev llvm make tk-dev wget xz-utils zlib1g-dev --yes

Install pyenv

curl -L https://github.com/pyenv/pyenv-installer/raw/master/bin/pyenv-installer | bash

Add to .zshrc / .bashrc

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

Open a new terminal, Install python 3.8.10

pyenv install 3.8.10

Activate this version

pyenv global 3.8.10 

Update pip

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