Did this while installing Azure CLI on my Mac.
At install time this had a dependency on Python 3.10 that I tried to resolve using the version 3.10.11 that was installed via Pyenv. Could not get this to work so uninstalled 3.10.11 via Pyenv, did a pyenv rehash
, and then installed 3.10.11 directly via Homebrew: brew install [email protected]
I then set up Pyenv to be able to use this new version via a variation of the instructions found here. This required some changes though because the symlinks weren't right in the example given because I wanted the specific version of Python installed via Homebrew. If I wanted python3
in my PATH without needing Pyenv the install would have been brew install python3
which likely would have meant the symlink setup below would have been different.
This is what I had to do.
cd ~/.pyenv/versions
ln -sfv "$(brew --prefix [email protected])" 3.10.11
pyenv rehash
cd /opt/homebrew/Cellar/[email protected]/3.10.11
ln -sfv ../Frameworks/Python.framework/Versions/3.10/bin/idle3.10 idle3
ln -sfv ../Frameworks/Python.framework/Versions/3.10/bin/idle3.10 idle
ln -sfv pip3.10 pip
ln -sfv pip3.10 pip3
ln -sfv ../Frameworks/Python.framework/Versions/3.10/bin/python3.10 python3
ln -sfv ../Frameworks/Python.framework/Versions/3.10/bin/python3.10 python
ln -sfv wheel3.10 wheel
ln -sfv wheel3.10 wheel3
ln -sfv ../Frameworks/Python.framework/Versions/3.10/bin/pydoc3.10 pydoc
ln -sfv ../Frameworks/Python.framework/Versions/3.10/bin/pydoc3.10 pydoc3
pyenv rehash