Search This Blog

Saturday, February 27, 2021

pyenv install error on MacOS Big Sur - sendfile invalid

There seems to be some issue going on with pyenv and MacOS Big Sur.


./Modules/posixmodule.c:8320:15: error: implicit declaration of function 'sendfile' is invalid in C99 [-Werror,-Wimplicit-function-declaration]

        ret = sendfile(in, out, offset, &sbytes, &sf, flags);


After referring multiple posts, this is what worked for me.

brew install zlib bzip2

CFLAGS="-I$(brew --prefix openssl)/include -I$(brew --prefix bzip2)/include -I$(brew --prefix readline)/include -I$(xcrun --show-sdk-path)/usr/include" LDFLAGS="-L$(brew --prefix openssl)/lib -L$(brew --prefix readline)/lib -L$(brew --prefix zlib)/lib -L$(brew --prefix bzip2)/lib" pyenv install 3.5.3 --patch < <(curl -sSL https://github.com/python/cpython/commit/8ea6353.patch\?full_index\=1)

No comments: