如果你还没有准备好开发环境,你不妨花上一小点时间去看看:**

这个是由于PIL没有编译freetype导致的
查看 lib/python2.7/site-packages/PIL/
看看 _imagingft.so 是否存在

本篇blog是有关python操作mysql数据的相关内容。

# 需要先安装jpeg库
wget
tar -zxvf jpegsrc.v7.tar.gz
cd jpeg-7
CC=”gcc -arch x86_64″
./configure –enable-shared –enable-static
make
make install
# 然后再安装PIL库


我做了一个demo:

1、安装freetype开发库
yum install freetype-devel


先看运行效果:

2、下载源代码


图片 1

3、修改setup.py文件
修改


JPEG_ROOT = libinclude(“/usr/local”)
FREETYPE_ROOT = ‘/usr/lib64′,’/usr/include/freetype2/freetype’

图片 2

图片 3

4、查看支持项
python setup.py build_ext -i
— FREETYPE2 support available  注意这一项

02.>>> t1 = (, 42, [1, 2, 303.>>>04.(, 42, [1, 2, 305.>>> p1 =06.>>>07.8.>>> 9.(S  
1011121314151617.>>> t2 =18.>>>19.(, 42, [1, 2, 320.>>> p2 =21.>>>22.  
23.>>> t3 =24.>>>25.(, 42, [1, 2, 3], None)  
 DATABASE_NAME = 

 HOST = 

 PORT = 

 USER_NAME = 

 PASSWORD = 

 CHAR_SET = 


           DATABASE_NAME = 
          HOST = 
          PORT = 
          USER_NAME = 
          PASSWORD = 
          CHAR_SET = 


        MySQLdb.connect(host = HOST, user = USER_NAME, passwd = PASSWORD, db = DATABASE_NAME, charset = 



       conn !=  

       cursor !=  



      sql = 

     conn =     cursor =     result =        

       table_name !=          sql =  +         conn =         cursor =         result =          row                           

               ( 

      sql = 
     params = (, ,      conn =     cursor =     result =        

      sql = 
     params = (     conn =     cursor =     result =        

      sql = 
     params = (     conn =     cursor =     result =        

      ( + DATABASE_NAME + HOST + PORT + USER_NAME + PASSWORD + 

      sql = 
     conn =     cursor =     result =      row                   

      sql = 
     conn =     cursor =     result =      row           


     result =          
     query_table(     
          (     query_table(     
          (     query_table(     
      (     query_table(      


   ==      main()

5、编译安装
python setup.py install

图片 4

你还可以参考:

若上面的设置都失败,则只能拿出下面的杀手锏:


sudo apt-get build-dep python-imaging

sudo ln -s /usr/lib/`uname -i`-linux-gnu/libfreetype.so /usr/lib/
sudo ln -s /usr/lib/`uname -i`-linux-gnu/libjpeg.so /usr/lib/
sudo ln -s /usr/lib/`uname -i`-linux-gnu/libz.so /usr/lib/

pip install -U PIL

当现下面的提示时,则说明安装成功了:

--------------------------------------------------------------------.--------------------------------------------------------------------.. (default, Apr  , ::.--------------------------------------------------------------------
--------- ZLIB (PNG/---***--------------------------------------------------------------------

图片 5

本篇blog是有关python操作mysql数据的相关内容。 我做了一个demo:
先看运行效…

 

02.>>> b1 = {1: , 2: , 3: 03.>>> c1 = [, , , 04.>>> f1 = file(, 05.>>>06.>>>07.>>>8.>>>9.>>> f2 = file(, 10.>>> a2 =11.>>>12.  
13.>>> b2 =14.>>>15.{1: , 2: , 3: 16.>>> c2 =17.>>>18.[, , , 19.>>> f2.close()  

 

图片 6

查看
lib/python2.7/site-packages/PIL/ 看看 _imagingft.so 是否存在 #
需要先安装jpeg库 wget …




02.  
03.>>>04.[, , ]  


图片 7

02.>>> b =03.>>>04.[1, 2, 305.>>>06.[1, 2, 307.>>> a.append(48.>>>9.[1, 2, 3, 410.>>>11.[1, 2, 3, 412.>>> c =13.>>> d, e =14.>>>15.[1, 2, 3, 416.>>>17.[1, 2, 3, 418.>>> d.append(519.>>>20.[1, 2, 3, 4, 521.>>>22.[1, 2, 3, 4, 5]  

图片 8



图片 9

02.>>>03.>>>04.[1, 2, 305.>>> l[306.[1, 2, 307.>>> l[3][38.[1, 2, 39.>>> p =10.>>> l2 =11.>>>12.[1, 2, 313.>>> l2[314.[1, 2, 315.>>> l2[3][316.[1, 2, 3, [...]]  

图片 10


发表评论

电子邮件地址不会被公开。 必填项已用*标注