Use pyenv to build a full functional Python interpreter on macOS Big Sur(11.1)

no build errors tkinter module enabled openssl from homebrew CPython with Framework support 1 2 3 4 5 6 brew install zlib bzip2 tcl-tk openssl py_version="3.6.11" CFLAGS="-I$(brew --prefix openssl)/include -I$(brew --prefix bzip2)/include -I$(brew --prefix readline)/include -I$(xcrun --show-sdk-path)/usr/include -I$(brew --prefix tcl-tk)/include" \ LDFLAGS="-L$(brew --prefix openssl)/lib -L$(brew --prefix readline)/lib -L$(brew --prefix zlib)/lib -L$(brew --prefix bzip2)/lib -L$(brew --prefix tcl-tk)/lib" \ PYTHON_CONFIGURE_OPTS="--with-tcltk-includes='-I/usr/local/opt/tcl-tk/include' --with-tcltk-libs='-L/usr/local/opt/tcl-tk/lib -ltcl8.

Compiling Python with latest OpenSSL on earlier version macOS

I used to write some Python scripts, and some of them crashed when run on earlier version of macOS(<10.15.x). A typical exception may like this: 1 2 3 4 urllib3.exceptions.MaxRetryError: HTTPSConnectionPool( host='xxx.com', port=443): Max retries exceeded with url: / (Caused by SSLError(SSLError(1, '[SSL: TLSV1_ALERT_PROTOCOL_VERSION] tlsv1 alert protocol version (_ssl.