Forem

Hiro Takkii
Hiro Takkii

Posted on

4 2

pyenv install 3.8.2 BUILD FAILED (OS X 11.5.2 using python-build 20180424)

Introduction

Following command failed.

❯ pyenv install 3.8.2
python-build: use openssl@1.1 from homebrew
python-build: use readline from homebrew
Installing Python-3.8.2...
python-build: use readline from homebrew
python-build: use zlib from xcode sdk

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

Inspect or clean up the working tree at /var/folders/96/vjhghky10417fblgh4m1ltcw0000gn/T/python-build.20220212200129.83880
Results logged to /var/folders/96/vjhghky10417fblgh4m1ltcw0000gn/T/python-build.20220212200129.83880.log

Last 10 log lines:
                                                     ^
clang -c -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include   -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include   -std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -Wstrict-prototypes -Werror=implicit-function-declaration  -I./Include/internal  -I. -I./Include -I/usr/local/opt/readline/include -I/usr/local/opt/readline/include -I/Users/hiro_takkii/.pyenv/versions/3.8.2/include -I/usr/local/opt/zlib/include -I/usr/local/opt/readline/include -I/usr/local/opt/readline/include -I/Users/hiro_takkii/.pyenv/versions/3.8.2/include -I/usr/local/opt/zlib/include  -DPy_BUILD_CORE -o Modules/gcmodule.o Modules/gcmodule.c
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include   -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include   -std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -Wstrict-prototypes -Werror=implicit-function-declaration  -I./Include/internal  -I. -I./Include -I/usr/local/opt/readline/include -I/usr/local/opt/readline/include -I/Users/hiro_takkii/.pyenv/versions/3.8.2/include -I/usr/local/opt/zlib/include -I/usr/local/opt/readline/include -I/usr/local/opt/readline/include -I/Users/hiro_takkii/.pyenv/versions/3.8.2/include -I/usr/local/opt/zlib/include  -DPy_BUILD_CORE_BUILTIN  -DPy_BUILD_CORE_BUILTIN -I./Include/internal -c ./Modules/posixmodule.c -o Modules/posixmodule.o
./Modules/posixmodule.c:9197:15: error: implicit declaration of function 'sendfile' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
        ret = sendfile(in, out, offset, &sbytes, &sf, flags);
              ^
1 error generated.
make: *** [Modules/posixmodule.o] Error 1
make: *** Waiting for unfinished jobs....
1 warning generated.
Enter fullscreen mode Exit fullscreen mode

Solution

You can install with patch-flag.

> Install with the --patch flag
pyenv install --patch 3.8.2 < <(curl -sSL https://github.com/python/cpython/commit/8ea6353.patch)

python-build: use openssl@1.1 from homebrew
python-build: use readline from homebrew
Installing Python-3.8.2...
patching file Misc/NEWS.d/next/macOS/2020-06-24-13-51-57.bpo-41100.mcHdc5.rst
patching file configure
Hunk #1 succeeded at 3394 (offset -32 lines).
patching file configure.ac
Hunk #1 succeeded at 498 (offset -12 lines).
python-build: use readline from homebrew
python-build: use zlib from xcode sdk

Installed Python-3.8.2 to /Users/hiro_takkii/.pyenv/versions/3.8.2
Enter fullscreen mode Exit fullscreen mode

Thanks.

Reference

Unable to build Python on macOS Big Sur with Xcode 12 beta

Image of Timescale

🚀 pgai Vectorizer: SQLAlchemy and LiteLLM Make Vector Search Simple

We built pgai Vectorizer to simplify embedding management for AI applications—without needing a separate database or complex infrastructure. Since launch, developers have created over 3,000 vectorizers on Timescale Cloud, with many more self-hosted.

Read full post →

Top comments (0)

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more

👋 Kindness is contagious

Dive into an ocean of knowledge with this thought-provoking post, revered deeply within the supportive DEV Community. Developers of all levels are welcome to join and enhance our collective intelligence.

Saying a simple "thank you" can brighten someone's day. Share your gratitude in the comments below!

On DEV, sharing ideas eases our path and fortifies our community connections. Found this helpful? Sending a quick thanks to the author can be profoundly valued.

Okay