I'm trying to install pyenv and poetry on my Macbook Pro running Big Sur.
I followed all the instructions and help I could find online, but I'm stuck when trying to install a global Python version using pyenv install 3.9.0
This just produces the following output:
pyenv install 3.9.0
python-build: use openssl@1.1 from homebrew
python-build: use readline from homebrew
Downloading Python-3.9.0.tar.xz...
-> https://www.python.org/ftp/python/3.9.0/Python-3.9.0.tar.xz
Installing Python-3.9.0...
python-build: use readline from homebrew
python-build: use zlib from xcode sdk
BUILD FAILED (OS X 11.4 using python-build 20180424)
Inspect or clean up the working tree at /var/folders/_3/3n7g_jr918v2cj_pkdlfk5t40000gn/T/python-build.20210619130847.19436
Results logged to /var/folders/_3/3n7g_jr918v2cj_pkdlfk5t40000gn/T/python-build.20210619130847.19436.log
Last 10 log lines:
checking for python3... python3
checking for --enable-universalsdk... no
checking for --with-universal-archs... no
checking MACHDEP... "darwin"
checking for gcc... clang
checking whether the C compiler works... no
configure: error: in `/var/folders/_3/3n7g_jr918v2cj_pkdlfk5t40000gn/T/python-build.20210619130847.19436/Python-3.9.0':
configure: error: C compiler cannot create executables
See `config.log' for more details
make: *** No targets specified and no makefile found. Stop.
I created and added the following to a .zprofile file in my home folder - restarted shell even though it seems one does not need to do this on macosx...:
cat .zprofile
export PYENV_ROOT="$HOME/.pyenv"
export PATH="$PYENV_ROOT/bin:$PATH"
eval "$(pyenv init --path)"
The command line C compiler utils are installed for XCode.