I appreciate there are tons of this messages around, and I read a few since last year when I first attempted the installation of the 3.9.0. The most recent ones with some kind of additional hints:
No matter what kind of environment variable I set, whether the XCode is update to the most recent 12.5 or stick to the 12.3 (which HomeBrew packages reports as obsolete), I still can't get pyenv installing the 3.9.1.
Homebrew, on the other end has the 3.9.1 and 3.9.5 installed so somehow the compilers are in place and are working.
The most recent attempt I gave is using the following environment variables:
export MACOSX_DEPLOYMENT_TARGET="$(sw_vers -productVersion | cut -c -5)"
export LIBRARY_PATH="$(brew --prefix openssl)/lib:${LIBRARY_PATH}"
export PYTHON_CONFIGURE_OPTS="--enable-framework
export PYTHON_CONFIGURE_OPTS="--with-openssl=$(brew --prefix openssl) ${PYTHON_CONFIGURE_OPTS}"
export LDFLAGS="-L$(brew --prefix zlib)/lib -L$(brew --prefix bzip2)/lib"
export CPPFLAGS="-I$(brew --prefix zlib)/include -I$(brew --prefix bzip2)/include"
export CFLAGS="-I$(brew --prefix openssl)/include -I$(brew --prefix bzip2)/include -I$(brew --prefix zlib)/include -I$(brew --prefix readline)/include -I$(xcrun --show-sdk-path)/usr/include"
export LDFLAGS="-L$(brew --prefix openssl)/lib -L$(brew --prefix readline)/lib -L$(brew --prefix zlib)/lib -L$(brew --prefix bzip2)/lib"
The following error message appears, consistently.
BUILD FAILED (OS X 11.4 using python-build 20180424)
Inspect or clean up the working tree at /var/folders/c_/ll8fp86d39d2qthh_cbg8vlc0000gp/T/python-build.20210701193101.41835
Results logged to /var/folders/c_/ll8fp86d39d2qthh_cbg8vlc0000gp/T/python-build.20210701193101.41835.log
Last 10 log lines:
checking for python3.9... python3.9
checking for --enable-universalsdk... no
checking for --with-universal-archs... no
checking MACHDEP... "darwin"
checking for gcc... gcc-10
checking whether the C compiler works... no
configure: error: in `/var/folders/c_/ll8fp86d39d2qthh_cbg8vlc0000gp/T/python-build.20210701193101.41835/Python-3.9.1':
configure: error: C compiler cannot create executables
See `config.log' for more details
make: *** No targets specified and no makefile found. Stop.
What makes me suspicious is the last line, that is slightly different from other post similar to mine. Or the one where it says "C compiler cannot create executables" which I thought it was linked to iTerm not having full Disk permissions, which is not the case.
I don't have a clue of what this target is, that's why I thought the above export could have helped, but that's not the case. Some sites suggest the necessity to run a make, which I expect pyenv to do, but then fact there is not a makefile (I assume a CMakeLists.txt) is again opening to a whole new set of problems.
Is there anybody that has experienced the same or could help me figuring this out?
--
UPDATE
Config file gist available here
Just noticed that when I do a pyenv which gcc
the output says /usr/bin/gcc. Given that CommandLine Tools and/or HomeBrew gcc should be used, couldn't this be the cause of the problems?