I recently upgraded from Sierra to Mojave. After that I tried to use pyenv install 3.5.6
. This uses homebrew in the background to try to install python, which fails
It helped me as well, answer is here: https://github.com/Homebrew/homebrew-core/issues/29176 More details, this works:
brew update
(Re)Install CLT.
installer -pkg /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg -target /
brew reinstall python@2
I needed an extra step to get it running on Mojave 10.14.05, Python 3.7. First:
export PATH="$PATH:/Library/Frameworks/Python.framework/Versions/3.6/bin"
then
sudo installer -pkg /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg -target /
see this post.
https://github.com/pyenv/pyenv/issues/1219
sudo installer -pkg /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg -target /