解決PIL “decoder jpeg not available” 和 “ImportError: The _imaging C module is not installed”的問題

來源:互聯網
上載者:User

標籤:blog   http   os   使用   ar   art   sp   問題   log   

在python安裝Image後發現只要載入ImageFont就出現 The _imaging C module is not installed  的提示,經百度Google搜尋後。
發現WIN系統的人都會使用網上已經編譯好的一個包。而LINUX下回答都很模糊。

基本如下處理即可(CENTOS 5 64bit)

yum install libjpeg libjpeg-devel zlib zlib-devel freetype freetype-devel lcms lcms-devel

以上安裝基本環境後。
wget http://effbot.org/downloads/Imaging-1.1.7.tar.gz
tar zxvf Imaging-1.1.7.tar.gz
進去後
vi setup.py
尋找
FREETYPE_ROOT = None
ZLIB_ROOT =None
替換為
ZLIB_ROOT = ("/usr/lib64/", "/usr/include")
FREETYPE_ROOT = ("/usr/lib64/",
    "/usr/include/freetype2/freetype")
儲存 退出後,
python setup.py build_ext -i
python setup.py build
python setup.py install

基本上就OK了。想知道是否OK
就python後輸入
import ImageFont
如果不出錯就O了。。

 

轉自:http://blog.csdn.net/shellshine/article/details/8286210

解決PIL “decoder jpeg not available” 和 “ImportError: The _imaging C module is not installed”的問題

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.