首页
Mac m1 安装 Pillow
  1. 安装依赖:
brew install libtiff libjpeg webp little-cms2 zlib
  1. 手动导出zlib的环境变量:

zlib is keg-only, which means it was not symlinked into /opt/homebrew,

because macOS already provides this software and installing another version in

parallel can cause all kinds of trouble.

For compilers to find zlib you may need to set:

export LDFLAGS="-L/opt/homebrew/opt/zlib/lib"

export CPPFLAGS="-I/opt/homebrew/opt/zlib/include"

For pkg-config to find zlib you may need to set:

export PKG_CONFIG_PATH="/opt/homebrew/opt/zlib/lib/pkgconfig"

export LDFLAGS="-L/opt/homebrew/opt/zlib/lib"
export CPPFLAGS="-I/opt/homebrew/opt/zlib/include"
export PKG_CONFIG_PATH="/opt/homebrew/opt/zlib/lib/pkgconfig"
pip install Pillow==4.2.0