brew upgrade
brew install pyenv
brew install pyenv-virtualenv
Add the following lines to ~/.zprofile and ~/.zshrc (or ~/.bash_profile and ~/.bashrc if you’re still using bash):
~/.zprofile
eval "$(pyenv init --path)"
~/.zshrc
if command -v pyenv 1>/dev/null 2>&1; then
eval "$(pyenv init -)"
fi
pyenv versions
pyenv install -l
pyenv install 3.10.2
pyenv versions
pyenv virtualenv 3.10.2 venv_3_10_2
pyenv virtualenvs
pyenv activate venv_3_10_2
pyenv exec python -m pip install pyspark
pyenv deactivate venv_3_10_2
pyenv virtualenv-delete venv_3_10_2
https://fathomtech.io/blog/python-environments-with-pyenv-and-vitualenv/ https://towardsdatascience.com/how-to-use-manage-multiple-python-versions-on-an-apple-silicon-m1-mac-d69ee6ed0250