BUILD FAILED (OS X 10.16 using python-build 20180424)
Inspect or clean up the working tree at /var/folders/sl/5j1zvmtj0gb8qpgkklkf38dh0000gr/T/python-build.20200626170507.14625
Results logged to /var/folders/sl/5j1zvmtj0gb8qpgkklkf38dh0000gr/T/python-build.20200626170507.14625.logLast 10 log lines:
./Modules/posixmodule.c:9141:12: note: forward declaration of 'struct sf_hdtr'
struct sf_hdtr sf;
^
./Modules/posixmodule.c:9221:15: error: implicit declaration of function 'sendfile' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
ret = sendfile(in, out, offset, &sbytes, &sf, flags);
^
2 errors generated.
make: *** [Modules/posixmodule.o] Error 1
make: *** Waiting for unfinished jobs....
使用以下命令安装
```
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 --patch 3.7.4 < <(curl -sSL https://github.com/python/cpython/commit/8ea6353.patch\?full_index\=1)
```
如果需要安装其他版本,把命令中的3.7.4修改成需要的版本。