安装 Python Imaging Library


http://www.pythonware.com/products/pil/

The Python Imaging Library (PIL) adds image processing capabilities to your Python interpreter. This library supports many file formats, and provides powerful image processing and graphics capabilities.

从源码安装,出错:



……
copying PIL\TiffImagePlugin.py -> build\lib.win-amd64-2.7
copying PIL\TiffTags.py -> build\lib.win-amd64-2.7
copying PIL\WalImageFile.py -> build\lib.win-amd64-2.7
copying PIL\WmfImagePlugin.py -> build\lib.win-amd64-2.7
copying PIL\XbmImagePlugin.py -> build\lib.win-amd64-2.7
copying PIL\XpmImagePlugin.py -> build\lib.win-amd64-2.7
copying PIL\XVThumbImagePlugin.py -> build\lib.win-amd64-2.7
copying PIL\__init__.py -> build\lib.win-amd64-2.7
running build_ext
--- using Tcl/Tk libraries at C:\python27\Tcl
--- using Tcl/Tk version 8.5
building '_imaging' extension
error: Unable to find vcvarsall.bat



解决办法:


1、首先安装MinGW,在MinGW的安装目录下找到bin的文件夹,找到mingw32-make.exe,复制一份更名为make.exe;

2、把MinGW的路径添加到环境变量path中;

3、打开命令行窗口,在命令行窗口中进入到要安装代码的目录下;

4、输入如下命令就可以安装了。

setup.py install build --compiler=mingw32

你可能感兴趣的:(python,py)