开始使用如下命令:

pip install pil

报如下错误

Collecting pil
  Could not find a version that satisfies the requirement pil (from versions: )
  Some externally hosted files were ignored as access to them may be unreliable (use --allow-external pil to allow).
No matching distribution found for pil

后来查了解决办法:见http://stackoverflow.com/questions/19532125/cant-install-pil-after-mac-os-x-10-9

使用如下步骤

pip install Pillow
ln -s ../Cellar/freetype/2.6_1/include/freetype2 freetype
pip install pil --allow-external pil --allow-unverified pil
pip install Pillow

成功安装