安裝 pip install Pillow==3.4.1 的時(shí)候出錯(cuò)
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以上的版本需要有依賴庫(kù), libjpeg和zlib
mac安裝方法:
- 打開終端窗口, 粘貼以下腳本。安裝brew
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
- 通過(guò)brew安裝libjpeg
brew install libjpeg zlib
- 通過(guò)brew安裝zlib
brew tap homebrew/dupes
brew install zlib
brew link zlib --force
之后再正常安裝pillow即可
其他平臺(tái),windows和linux安裝方法可去:
官網(wǎng)查詢
中文文檔傳送