Mac上通过pyenv安装python3.7.3

很早之前写过一个Python版本的Telegram bot,决定回炉重构后继续跑到新的k8s里。

安装python 3.7.3

安装问题遇到了 zipimport.ZipImportError: can't decompress data; zlib not available

brew install zlib

cat >> ~/.zshrc <<EOF
# For compilers to find zlib you may need to set:
export LDFLAGS="${LDFLAGS} -L/usr/local/opt/zlib/lib"
export CPPFLAGS="${CPPFLAGS} -I/usr/local/opt/zlib/include"

# For pkg-config to find zlib you may need to set:
export PKG_CONFIG_PATH="${PKG_CONFIG_PATH} /usr/local/opt/zlib/lib/pkgconfig"
EOF

source ~/.zshrc

pyenv install 3.7.3

Code 配置

cd ~/Work/Godu/GoduBot
pyenv local 3.7.3

又水了一篇

推荐阅读