DEV Community

gie3d
gie3d

Posted on

Multi python versions on Mac using pyenv

install using Homebrew

brew update
Enter fullscreen mode Exit fullscreen mode
brew install pyenv
Enter fullscreen mode Exit fullscreen mode

Configure your Mac's environment

Depends on your shell (mine was zsh)

echo 'eval "$(pyenv init -)"' >> ~/.zshrc
Enter fullscreen mode Exit fullscreen mode

Activate the change

source ~/.zshrc
Enter fullscreen mode Exit fullscreen mode

Install a version of Python

pyenv install python3.4.10
Enter fullscreen mode Exit fullscreen mode

Set your environment python

pyenv local python3.4.10
Enter fullscreen mode Exit fullscreen mode

Top comments (1)

Collapse
 
waylonwalker profile image
Waylon Walker

I've always used conda for different versions on my local machine, but within CI all of the "Marketplace" actions use pyenv. This might be one that I consider next time I setup a dev machine.