- https://github.com/pyenv/pyenv
- Simple Python version management
Installation
Prerequisites
For pyenv to install python correctly you should install the Python build dependencies.
macOS
brew update
brew install pyenvpyenv which python3pyenv install --list | grep 3.11 3.11.0
3.11-dev
3.11.1
miniconda3-4.3.11pyenv-virtualenv
pyenv-virtualenv is a pyenv plugin that provides features to manage virtualenvs and conda environments for Python on UNIX-like systems.
brew install pyenv-virtualenv(OPTIONAL) Add pyenv virtualenv-init to your shell to enable auto-activation of virtualenvs. This is entirely optional but pretty useful.
echo 'eval "$(pyenv virtualenv-init -)"' >> ~/.zshrcpyenv install 3.13.2
pyenv virtualenv 3.13.2 mysite
pyenv local mysite
pyenv which python3
pyenv which pip3
pip3 install --upgrade pippip3 freeze > requirements.txt