Here we are going to install the latest Python (3.11.2 as of this writing) and Ansible on macOS Ventura in the most clever and simplistic way. All artifacts are installed in user and not system context.
How does it work? The awesome asdf-vm project is designed for version management of developer runtimes.
Here we use a small feature to also directly install default-python-packages
and pick Ansible as our choice (could be pipenv or others).
Some features here have been presented in my talk "Runtime and tools – version management on macOS" at the MDO:YVR 2022 conference.
- macOS 12 or macOS 13
- asdf dependencies (via homebrew) as listed here
## add asdf
git clone https://github.com/asdf-vm/asdf.git ~/.asdf --branch v0.11.2
## edit zsh conf
nano ~/.zshrc
## add `. "$HOME/.asdf/asdf.sh"`
. "$HOME/.asdf/asdf.sh"
## activate
source ~/.zshrc
## add ansible to "default-python-packages"
echo ansible > $HOME/.default-python-packages
## install Python plugin
asdf plugin add python
## install latest python
asdf install python latest
## set global
asdf global python latest
## check Python version
python --version
## check Ansible version
ansible --version
You find more info about asdf here on this blog post.
Macadmins can join the #asdf
channel on macadmins-slack.
The result