p:: Python, CLI

Installation

Prerequisites

For pyenv to install python correctly you should install the Python build dependencies.

macOS

brew update
brew install pyenv
pyenv which python3
pyenv install --list | grep 3.11
  3.11.0
  3.11-dev
  3.11.1
  miniconda3-4.3.11

pyenv-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 -)"' >> ~/.zshrc
pyenv install 3.11.1
pyenv virtualenv 3.11.1 mysite
pyenv local mysite
 
pyenv which python3
pyenv which pip3
 
pip3 install --upgrade pip
pip3 freeze > requirements.txt