解決CentOS下匯入ImageFont報錯相關問題

來源:互聯網
上載者:User

解決CentOS下匯入ImageFont報錯相關問題

centos6 64位安裝pil一直沒裝上,度娘無數,最近裝上了。特此記錄。主要問題是匯入ImageFont報錯。

  1. 編譯PIL安裝最後會提示差庫,先yum install xxx*一路全裝上

複製了。。

這個是由於PIL沒有編譯freetype導致的,查看 lib/python2.7/site-packages/PIL/,看看 _imagingft.so 是否存在

#需要先安裝jpeg庫wgethttp://www.ijg.org/files/jpegsrc.v7.tar.gztar-zxvfjpegsrc.v7.tar.gzcdjpeg-7CC="gcc-archx86_64"./configure--enable-shared--enable-staticmakemakeinstall

然後再安裝PIL庫

讓PIL支援freetype的方法

1、安裝freetype開發庫

yuminstallfreetype-devel

2、下載原始碼http://effbot.org/downloads/Imaging-1.1.7.tar.gz

3、修改setup.py檔案

修改

JPEG_ROOT=libinclude("/usr/local")FREETYPE_ROOT='/usr/lib64','/usr/include/freetype2/freetype'

4、查看支援項

pythonsetup.pybuild_ext-i

--- FREETYPE2 support available 注意這一項

5、編譯安裝

python setup.py install

6.最重要的一步把jpeg加入導系統庫路徑

echo "/usr/local\lib" >>/etc/ld.so.conf

ldconfig

奉上,win764 位元的pil
附件下載:
  pil-1.1.7-win64位

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.