Reputation: 838
Trying to install python 3 via:
LDFLAGS="-L/opt/local/lib/" CPPFLAGS="-I/opt/local/include -L/opt /local/lib" C_INCLUDE_PATH="/opt/local/include" LIBRARY_PATH=" /opt/local/lib" pyenv install 3.7.3
I get:
python-build: use [email protected] from homebrew
python-build: use readline from homebrew
Downloading Python-3.7.3.tar.xz...
-> https://www.python.org/ftp/python/3.7.3/Python-3.7.3.tar.xz
Installing Python-3.7.3...
python-build: use readline from homebrew
BUILD FAILED (OS X 10.15.4 using python-build 20180424)
Inspect or clean up the working tree at /var/folders/qg/bfsy6h2j1_76gh41ngnnwgdh0000gn/T/python-build.20200508155826.1859
Results logged to /var/folders/qg/bfsy6h2j1_76gh41ngnnwgdh0000gn/T/python-build.20200508155826.1859.log
Last 10 log lines:
checking for --enable-universalsdk... no
checking for --with-universal-archs... no
checking MACHDEP... checking for --without-gcc... no
checking for --with-icc... no
checking for gcc... clang
checking whether the C compiler works... no
configure: error: in `/var/folders/qg/bfsy6h2j1_76gh41ngnnwgdh0000gn/T/python-build.20200508155826.1859/Python-3.7.3':
configure: error: C compiler cannot create executables
See `config.log' for more details
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
Other resolutions for this issue are not quite the same I have not seen this error around related to pyenv, any clues? I previously had python3 installed with homebrew but I doubt this is the culprit given the error in the logs.
I have commandline tools installed.
Upvotes: 4
Views: 5170
Reputation: 64
As the error says:
Inspect or clean up the working tree at /var/folders/qg/bfsy6h2j1_76gh41ngnnwgdh0000gn/T/python-build.20200508155826.1859
And:
See `config.log' for more details
So one basically needs to look into /var/folders/qg/bfsy6h2j1_76gh41ngnnwgdh0000gn/T/python-build.20200508155826.1859/config.log
.
Since it failed while checking whether the C compiler works
, look for this text in the file: the error reason should be described just below.
Upvotes: 0
Reputation: 4414
If you are using WSL2 ubuntu and install pyenv via homebrew, one way to solve this is to install build-essential
and its friends.
sudo apt-get update; sudo apt-get install --no-install-recommends make build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev xz-utils tk-dev libxml2-dev libxmlsec1-dev libffi-dev liblzma-dev
Ref. the pyenv official guide. It has linuxbrew, macOS, other OSs as well.
Upvotes: 4