pyenv (Cache)ΒΆ

sudo apt update
sudo apt-get install -y build-essential curl libbz2-dev libffi-dev liblzma-dev libncurses5-dev libncursesw5-dev libreadline-dev libsqlite3-dev libssl-dev libxml2-dev libxmlsec1-dev llvm make tk-dev wget xz-utils zlib1g-dev
git clone --depth=1 https://github.com/pyenv/pyenv.git ~/.pyenv
vim ~/.zshrc
export PYENV_ROOT="$HOME/.pyenv"
[[ -d $PYENV_ROOT/bin ]] && export PATH="$PYENV_ROOT/bin:$PATH"
eval "$(pyenv init -)"
source ~/.zshrc

pyenv for Windows [3][4]ΒΆ

git clone --depth=1 https://github.com/pyenv-win/pyenv-win ~/.pyenv
pyenv install -l | findstr 3.7
pyenv install -l | findstr 3.11
pyenv install 3.7.9-win32
pyenv install 3.11.9
pyenv shell <version>

UsageΒΆ

# mkdir ~/.pyenv/cache
# cd ~/.pyenv/cache
# wget https://www.python.org/ftp/python/3.10.11/Python-3.10.11.tar.xz
pyenv install 3.10.11
pyenv global 3.10.11
# pyenv local 3.10.11