安装 pip install Pillow==3.4.1 的时候出错
ValueError: zlib is required unless explicitly disabled using --disable-zlib, aborting
Command "/Users/yangda/.virtualenvs/odoo-11.0/bin/python -u -c "import setuptools, tokenize;file='/private/tmp/pip-build-yaasygck/Pillow/setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" install --record /tmp/pip-ewnmibv8-record/install-record.txt --single-version-externally-managed --compile --install-headers /Users/yangda/.virtualenvs/odoo-11.0/include/site/python3.6/Pillow" failed with error code 1 in /private/tmp/pip-build-yaasygck/Pillow/
原因是pillow在3.0以上的版本需要有依赖库, libjpeg和zlib
mac安装方法:
- 打开终端窗口, 粘贴以下脚本。安装brew
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
- 通过brew安装libjpeg
brew install libjpeg zlib
- 通过brew安装zlib
brew tap homebrew/dupes
brew install zlib
brew link zlib --force
之后再正常安装pillow即可