4

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.

2
  • 1
    I have the same issue Commented Sep 7, 2020 at 19:16
  • I am using WSL2 ubuntu facing same issue. Commented Oct 22, 2020 at 6:34

2 Answers 2

4

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.

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks for this, helped me install python from source.
0

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.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.