Pip 虚拟环境中Mac OS Maverics上的PIL安装错误

Pip 虚拟环境中Mac OS Maverics上的PIL安装错误,pip,python-imaging-library,osx-mavericks,Pip,Python Imaging Library,Osx Mavericks,我正在尝试在虚拟内存中安装PIL,如下所示 pip intall PIL 我得到了下面的错误 Downloading/unpacking PIL Running setup.py egg_info for package PIL WARNING: '' not a valid package name; please use only.-separated package names in setup.py Installing collected packages: PIL

我正在尝试在虚拟内存中安装PIL,如下所示

pip intall PIL
我得到了下面的错误

Downloading/unpacking PIL
  Running setup.py egg_info for package PIL
    WARNING: '' not a valid package name; please use only.-separated package names in setup.py

Installing collected packages: PIL
  Running setup.py install for PIL
    WARNING: '' not a valid package name; please use only.-separated package names in setup.py
    --- using frameworks at /System/Library/Frameworks
    building '_imagingft' extension
    cc -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -Qunused-arguments -Qunused-arguments -pipe -Wno-error=unused-command-line-argument-hard-error-in-future -I/System/Library/Frameworks/Tcl.framework/Headers -I/System/Library/Frameworks/Tk.framework/Headers -I/usr/local/include/freetype2 -IlibImaging -I/opt/local/include -I/Users/user/.virtualenvs/proj/include -I/usr/local/include -I/usr/include -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c _imagingft.c -o build/temp.macosx-10.9-intel-2.7/_imagingft.o
    _imagingft.c:73:10: fatal error: 'freetype/fterrors.h' file not found
    #include <freetype/fterrors.h>
             ^
    1 error generated.
    error: command 'cc' failed with exit status 1
    Complete output from command /Users/user/.virtualenvs/proj/bin/python -c "import setuptools;__file__='/Users/user/.virtualenvs/proj/build/PIL/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /var/folders/x1/1bwt313j0qvgdh5pfzpbpvcw0000gn/T/pip-R5JSVs-record/install-record.txt --single-version-externally-managed --install-headers /Users/user/.virtualenvs/proj/include/site/python2.7:
    WARNING: '' not a valid package name; please use only.-separated package names in setup.py

running install

running build

running build_py

running build_ext

--- using frameworks at /System/Library/Frameworks

building '_imagingft' extension

cc -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -Qunused-arguments -Qunused-arguments -pipe -Wno-error=unused-command-line-argument-hard-error-in-future -I/System/Library/Frameworks/Tcl.framework/Headers -I/System/Library/Frameworks/Tk.framework/Headers -I/usr/local/include/freetype2 -IlibImaging -I/opt/local/include -I/Users/user/.virtualenvs/proj/include -I/usr/local/include -I/usr/include -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c _imagingft.c -o build/temp.macosx-10.9-intel-2.7/_imagingft.o

_imagingft.c:73:10: fatal error: 'freetype/fterrors.h' file not found

#include <freetype/fterrors.h>

         ^

1 error generated.

error: command 'cc' failed with exit status 1

----------------------------------------
Command /Users/user/.virtualenvs/proj/bin/python -c "import setuptools;__file__='/Users/user/.virtualenvs/proj/build/PIL/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /var/folders/x1/1bwt313j0qvgdh5pfzpbpvcw0000gn/T/pip-R5JSVs-record/install-record.txt --single-version-externally-managed --install-headers /Users/user/.virtualenvs/proj/include/site/python2.7 failed with error code 1 in /Users/user/.virtualenvs/proj/build/PIL
下载/解包PIL
正在为程序包PIL运行setup.py egg\u info
警告:“”不是有效的包名称;请仅使用-setup.py中分隔的包名称
安装收集的软件包:PIL
正在运行针对PIL的setup.py安装
警告:“”不是有效的包名称;请仅使用-setup.py中分隔的包名称
---使用位于/System/Library/frameworks的框架
建筑“\u-gft”扩建部分
cc-DNDEBUG-g-fwrapv-Os-Wall-Wstrict原型-Qunused arguments-Qunused arguments-pipe-Wno error=将来未使用的命令行参数硬错误-I/System/Library/Frameworks/Tcl.framework/Headers-I/System/Library/Frameworks/Tk.framework/Headers-I/usr/local/include/freetype2-IlibImaging-I/opt/local/include-I/Users/user/.virtualenvs/proj/include-I/usr/local/include-I/usr/include-I/System/Library/Frameworks/Python.Frameworks/Versions/2.7/include/python2.7-c\u imagingft.c-o build/temp.macosx-10.9-intel-2.7/\u imagingft.o
_imagingft.c:73:10:致命错误:“找不到freetype/fterrors.h”文件
#包括
^
生成1个错误。
错误:命令“cc”失败,退出状态为1
从命令/Users/user/.virtualenvs/proj/bin/python-c“导入setuptools;\uuu文件\uuuu='/Users/user/.virtualenvs/proj/build/PIL/setup.py';exec(编译(打开(\uu文件).read().replace('\r\n','\n'),\uu文件,'exec'))完成输出安装--record/var/folders/x1/1bwt313j0qvgdh5pfzpbpvcw0000gn/T/pip-R5JSVs-record/install-record.txt--外部管理的单一版本--安装头/Users/user/.virtualenvs/proj/include/site/python2.7:
警告:“”不是有效的包名称;请仅使用-setup.py中分隔的包名称
正在运行的安装
运行构建
运行build\u py
运行build_ext
---使用位于/System/Library/frameworks的框架
建筑“\u-gft”扩建部分
cc-DNDEBUG-g-fwrapv-Os-Wall-Wstrict原型-Qunused arguments-Qunused arguments-pipe-Wno error=将来未使用的命令行参数硬错误-I/System/Library/Frameworks/Tcl.framework/Headers-I/System/Library/Frameworks/Tk.framework/Headers-I/usr/local/include/freetype2-IlibImaging-I/opt/local/include-I/Users/user/.virtualenvs/proj/include-I/usr/local/include-I/usr/include-I/System/Library/Frameworks/Python.Frameworks/Versions/2.7/include/python2.7-c\u imagingft.c-o build/temp.macosx-10.9-intel-2.7/\u imagingft.o
_imagingft.c:73:10:致命错误:“找不到freetype/fterrors.h”文件
#包括
^
生成1个错误。
错误:命令“cc”失败,退出状态为1
----------------------------------------
Command/Users/user/.virtualenvs/proj/bin/python-c“导入setuptools;_文件_='/Users/user/.virtualenvs/proj/build/PIL/setup.py';exec(编译(打开(__文件_;).read().replace('\r\n','\n'),__u文件_u,'exec'))安装--record/var/folders/x1/1bwt313j0qvgdh5pfzpbpvcw0000gn/T/pip-R5JSVs-record/install-record.txt--外部管理的单一版本--安装头/Users/user/.virtualenvs/proj/include/site/python2.7失败,错误代码为/Users/user/.virtualenvs/proj/build/PIL中的1

那么,如何修复它,有人能告诉我为什么它会给我的新macbook air带来错误吗?

我建议你试试Pill的叉子枕头。我没有在虚拟机上尝试过,但在Mac OS X上,您可以这样做:

brew install libtiff libjpeg webp little-cms2

pip install Pillow
详情如下: