PIL安装步骤,已经整理好了对应版本的类库

下载安装PIL所需要的所有python类库文件,已经整理好,可以从这里下载。

自己安装时会出现各种版本不匹配,这里是一个已经正确部署的类库文件。

类库下载地址:

http://download.csdn.net/detail/wgw335363240/9460284

安装步骤:

     安装libjpeg:
     $ tar zxvf jpegsrc.v7.tar.gz
     $ cd jpeg-7
     $ ./configure --enable-shared --enable-static
     $ make
     $ sudo make install
     默认安装在了:/usr/local/lib下,不要修改安装位置,不然还得修改Imaging中的setup参数

     安装zlib:
     $ tar zxvf zlib-1.2.8.tar.gz
     $ cd zlib-1.2.8
     $ ./configure
     $ make
     $ sudo make install
     默认安装在了:/usr/local/lib下,不要修改安装位置,不然还得修改Imaging中的setup参数

     安装freetype
     $ tar zxf freetype-2.6.1.tar.gz
     $ cd freetype-2.6.1
     $ ./configure
     $ make
     $ sudo make install
     默认安装在了:/usr/local/lib下,不要修改安装位置,不然还得修改Imaging中的setup参数

     

     安装PIL
     $ unzip Imaging-1.1.7.zip
     $ cd Imaging-1.1.7
          a)修改setup.py文件,修改配置文件路径
               JPEG_ROOT = "/usr/local/include"
               ZLIB_ROOT = "/usr/local/include"
               FREETYPE_ROOT = "/usr/local/include"
          b)编译PIL:
               python setup.py build_ext -i
bash-3.2$  python setup.py build_ext -i
running build_ext
--- using frameworks at /System/Library/Frameworks
--------------------------------------------------------------------
PIL 1.1.7 SETUP SUMMARY
--------------------------------------------------------------------
version       1.1.7
platform      darwin 2.7.6 (default, Sep  9 2014, 15:04:36)
              [GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.39)]
--------------------------------------------------------------------
--- TKINTER support available
--- JPEG support available
--- ZLIB (PNG/ZIP) support available
--- FREETYPE2 support available
*** LITTLECMS support not available
--------------------------------------------------------------------
To add a missing option, make sure you have the required
library, and set the corresponding ROOT variable in the
setup.py script.

To check the build, run the selftest.py script.


          c)测试编译:
               python selftest.py
ash-3.2$ python selftest.py
--------------------------------------------------------------------
PIL 1.1.7 TEST SUMMARY 
--------------------------------------------------------------------
Python modules loaded from ./PIL
Binary modules loaded from ./PIL
--------------------------------------------------------------------
--- PIL CORE support ok
--- TKINTER support ok
--- JPEG support ok
--- ZLIB (PNG/ZIP) support ok
--- FREETYPE2 support ok
*** LITTLECMS support not installed
--------------------------------------------------------------------
Running selftest:
--- 57 tests passed.
bash-3.2$ 

          d)安装:
               python setup.py install

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 4
    评论
评论 4
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值