I'm still working on getting
pyenv in my bloodstream. It seems like totally the right tool for having different versions of Python available on macOS that don't suddenly break when you run
periodically. But every thing I tried failed with an error similar to this:
python-build: use openssl from homebrew python-build: use readline from homebrew Installing Python-3.7.0... python-build: use readline from homebrew BUILD FAILED (OS X 10.15.x using python-build 20XXXXXX) Inspect or clean up the working tree at /var/folders/mw/0ddksqyn4x18lbwftnc5dg0w0000gn/T/python-build.20190528163135.60751 Results logged to /var/folders/mw/0ddksqyn4x18lbwftnc5dg0w0000gn/T/python-build.20190528163135.60751.log Last 10 log lines: ./Modules/posixmodule.c:5924:9: warning: this function declaration is not a prototype [-Wstrict-prototypes] if (openpty(&master_fd, &slave_fd, NULL, NULL, NULL) != 0) ^ ./Modules/posixmodule.c:6018:11: error: implicit declaration of function 'forkpty' is invalid in C99 [-Werror,-Wimplicit-function-declaration] pid = forkpty(&master_fd, NULL, NULL, NULL); ^ ./Modules/posixmodule.c:6018:11: warning: this function declaration is not a prototype [-Wstrict-prototypes] 2 warnings and 2 errors generated. make: *** [Modules/posixmodule.o] Error 1 make: *** Waiting for unfinished jobs....
Until I saw this comment on an open
pyenv issue: "Unable to install any Python version on MacOS"
All I had to do was replace the
10.15 and now it finally worked here on Catalina 10.15. So, the magical line was this:
SDKROOT=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk \ MACOSX_DEPLOYMENT_TARGET=10.15 \ PYTHON_CONFIGURE_OPTS="--enable-framework" \ pyenv install -v 3.7.6
Hopefully, by blogging about it you'll find this from Googling and I'll remember the next time I need it because it did eat 2 hours of precious evening coding time.