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

来源:互联网 发布:内网管控软件 编辑:程序博客网 时间:2024/06/05 22:49

下载安装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 -irunning build_ext--- using frameworks at /System/Library/Frameworks--------------------------------------------------------------------PIL 1.1.7 SETUP SUMMARY--------------------------------------------------------------------version       1.1.7platform      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 requiredlibrary, and set the corresponding ROOT variable in thesetup.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 ./PILBinary 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 0
原创粉丝点击