Unable to Install python 3.6.8 using pyenv on mac Monterey 12.5.1

Viewed 464

I'm trying to install python 3.6.8 using pyenv on mac Monterey 12.5.1 but encountering below error

python-build: use openssl@1.1 from homebrew
python-build: use readline from homebrew
Installing Python-3.6.8...
patching file Misc/NEWS.d/next/macOS/2020-06-24-13-51-57.bpo-41100.mcHdc5.rst
patching file configure
Hunk #1 succeeded at 3375 (offset -51 lines).
patching file configure.ac
Hunk #1 succeeded at 495 (offset -15 lines).
python-build: use readline from homebrew
python-build: use zlib from xcode sdk

BUILD FAILED (OS X 12.5.1 using python-build 20180424)

Inspect or clean up the working tree at /var/folders/7h/p55vm3356_jg4jns3n8vngzm0000gp/T/python-build.20220823112323.4068
Results logged to /var/folders/7h/p55vm3356_jg4jns3n8vngzm0000gp/T/python-build.20220823112323.4068.log

Last 10 log lines:
checking for --with-cxx-main=<compiler>... no
checking for clang++... no
configure:

  By default, distutils will build C++ extension modules with "clang++".
  If this is not intended, then set CXX on the configure command line.
  
checking for the platform triplet based on compiler characteristics... darwin
configure: error: internal configure error for the platform triplet, please file a bug report
make: *** No targets specified and no makefile found.  Stop.

I have tried to reinstall pyenv but it does not help

I have also tried

CFLAGS="-I$(brew --prefix openssl)/include -I$(brew --prefix bzip2)/include -I$(brew --prefix readline)/include -I$(xcrun --show-sdk-path)/usr/include"

LDFLAGS="-L$(brew --prefix openssl)/lib -L$(brew --prefix readline)/lib -L$(brew --prefix zlib)/lib -L$(brew --prefix bzip2)/lib"

pyenv install --patch 3.6.8 < <(curl -sSL https://github.com/python/cpython/commit/8ea6353.patch\?full_index\=1)```
1 Answers

I had similar problem and doing installation by steps from this post helped me. Before following these steps, you better to uninstall all python versions you currently have and pyenv, homebrew.

Related