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

308 Views Asked by At

I have installed pyenv and was trying to install python, however am continuing to get build failed error and am not sure how to fix it.

Tried taking these steps but am still getting the same error

  • STEP 1: sudo rm -rf /Library/Developer/CommandLineTools
  • STEP 2: xcode-select --install
  • STEP 3: pyenv install 3.8.5

Still got the same error as before:

python-build: use openssl from homebrew
python-build: use readline from homebrew
Downloading Python-3.8.5.tar.xz...
-> https://www.python.org/ftp/python/3.8.5/Python-3.8.5.tar.xz
Installing Python-3.8.5...
patching file 'Misc/NEWS.d/next/Build/2021-10-11-16-27-38.bpo-45405.iSfdW5.rst'
patching file configure
patching file configure.ac
python-build: use readline from homebrew
python-build: use zlib from xcode sdk

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

Inspect or clean up the working tree at /var/folders/3q/f7sgq3p54sx7_3tk6d251wz00000gr/T/python-build.20240304113743.14799
Results logged to /var/folders/3q/f7sgq3p54sx7_3tk6d251wz00000gr/T/python-build.20240304113743.14799.log

Last 10 log lines:

checking size of _Bool... 1
checking size of off_t... 8
checking whether to enable large file support... no
checking size of time_t... 8
checking for pthread_t... yes
checking size of pthread_t... 8
checking size of pthread_key_t... 8
checking whether pthread_key_t is compatible with int... no
configure: error: Unexpected output of 'arch' on OSX
make: *** No targets specified and no makefile found.  Stop.
1

There are 1 best solutions below

0
ddreliv On

I had a similar issue on my Apple MacOS Sonama 14.4:

Solution

This is what worked for me:

[email protected] arch -x86_64 pyenv install 3.12.2

Context

  • I used Apple migration assistant to move from my Apple Intel based to the Apple M1 Max
  • My Terminal is running on arm64 while my brew command is running on x86_64

Two main issues:

1) Regarding chip arch between x86_64 and arm64

Even if I'm running my terminal in arm64, which I can verify by running arch command with the following result:

$ arch
arm64

Homebrew brew command is still running in x86_64 through Rosetta 2 on the terminal.

You can check this by running brew config:

brew config

HOMEBREW_VERSION: 4.2.14
...
macOS: 14.4-x86_64
...
Xcode: 15.3
Rosetta 2: true

With that information, it makes it easier to figure out which dependencies need to be installed and for which target chip architecture (arm64 or x86_64).

2) Openssl version and libb2

I ran into the following issue: ERROR:root:code for hash blake2s was not found

You might need to install libb2 for the target arch

Example:

arch -arm64 brew install libb2

This is also the reason why I'm specifying [email protected] on the installation command.

Other resources

You can find more detailed information here:

I hope this helps.