Skip to content

Instantly share code, notes, and snippets.

@manti-by
Last active November 12, 2024 08:27
Show Gist options
  • Select an option

  • Save manti-by/6b41c6621fb1fcbe38f8488f3175908e to your computer and use it in GitHub Desktop.

Select an option

Save manti-by/6b41c6621fb1fcbe38f8488f3175908e to your computer and use it in GitHub Desktop.

Install Pyenv

Install system libraries

sudo apt install gcc curl make git build-essential zlib1g-dev tk-dev \
    libssl-dev libxml2-dev libxmlsec1-dev libreadline-dev \
    liblzma-dev libbz2-dev libsqlite3-dev libffi-dev \
    libsasl2-dev libldap2-dev

Pyenv install

curl https://pyenv.run | bash

Add lines bellow to .bashrc and restart a shell

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

Virtual environment

pyenv install 3.10
pyenv virtualenv 3.10 test-env
pyenv activate test-env
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment