Skip to content

Instantly share code, notes, and snippets.

@KiranSatyaRaj
Last active February 10, 2023 08:07
Show Gist options
  • Save KiranSatyaRaj/1b99f51c3c5833132a14a923c945d3a5 to your computer and use it in GitHub Desktop.
Save KiranSatyaRaj/1b99f51c3c5833132a14a923c945d3a5 to your computer and use it in GitHub Desktop.
Installing Python and dependencies

For Debian-based systems

  • Installing essentials
sudo apt update &&
sudo apt install -y build-essential zlib1g-dev libssl-dev libreadline-dev libbz2-dev libsqlite3-dev libffi-dev tk-dev

For Arch-based systems

  • Installing essentials
sudo pacman -Syu
sudo pacman -S base-devel zlib openssl readline bzip2 sqlite3 libffi tk

  • Installing pyenv
curl -sS https://webi.sh/pyenv | sh

Add these to .bashrc file open - vim ~/.bashrc and click on i (insert mode)

## py-env
export PYENV_ROOT="$HOME/.pyenv"
command -v pyenv >/dev/null || export PATH="$PYENV_ROOT/bin:$PATH"
eval "$(pyenv init -)"

## py-env virtual
eval "$(pyenv virtualenv-init -)"
  • click esc and :wq

  • exit the terminal or ctrl + d

  • Installing python3

pyenv install -v 3.11.2 && pyenv global 3.11.2

check the version using python3 --version

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