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.
I had a similar issue on my Apple MacOS Sonama 14.4:
Solution
This is what worked for me:
Context
arm64while mybrewcommand is running onx86_64Two main issues:
1) Regarding chip
archbetweenx86_64andarm64Even if I'm running my terminal in
arm64, which I can verify by runningarchcommand with the following result:Homebrew
brewcommand is still running inx86_64throughRosetta 2on the terminal.You can check this by running
brew config:With that information, it makes it easier to figure out which dependencies need to be installed and for which target chip architecture (
arm64orx86_64).2) Openssl version and
libb2I ran into the following issue:
ERROR:root:code for hash blake2s was not foundYou might need to install
libb2for the targetarchExample:
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.