本文参考:https://github.com/pyenv/pyenv/wiki/Common-build-problems
Ubuntu / Debian 系统:
sudo apt-get install -y make build-essential libssl-dev zlib1g-dev libbz2-dev \
libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev libncursesw5-dev \
xz-utils tk-dev libffi-dev liblzma-dev
Fedro / Centos /RHEL 系统:
sudo yum install zlib-devel bzip2 bzip2-devel readline-devel sqlite sqlite-devel \
openssl-devel xz xz-devel libffi-devel
openSUSE :
zypper in zlib-devel bzip2 libbz2-devel readline-devel sqlite3 sqlite3-devel libopenssl-devel xz xz-devel
macOS:
brew install readline xz
如果你的 macOS 是Mojave or higher (10.14+)
sudo installer -pkg /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg -target /
NOTE: libssl-dev
is required when compiling Python, installing libssl-dev
will actually install zlib1g-dev
, which leads to uninstall and re-install Python versions (installed before installing libssl-dev). On Redhat and derivatives the package is named openssl-devel
.
网友评论