Python安裝Imaging報錯:The _imaging C module is not installed問題解決方案_python

來源:互聯網
上載者:User

今天寫Python程式上傳圖片需要用到PIL庫,於是到http://www.pythonware.com/products/pil/#pil117下載了一個1.1.7版本的,我用的是CentOS64 並且自行升級後的Python版本安裝PIL庫
首先下載解壓:

複製代碼 代碼如下:

[root@lee ~]# wget http://www.pythonware.com/products/pil/#pil117
[root@lee ~]# tar -xf Imaging-1.1.7.tar.gz

然後準備安裝
複製代碼 代碼如下:

[root@lee ~]# cd Imaging-1.1.7
[root@lee Imaging-1.1.7]# python python setup.py build_ext -i

都沒問題,當測試安裝的時候卻老提示:*** The _imaging C module is not installed
複製代碼 代碼如下:

[root@lee Imaging-1.1.7]# python selftest.py
*** The _imaging C module is not installed

找了半天,也找不出是什麼原因,後來終於在官網從一堆英文中找到了關鍵所在,解決方案,實際根據自己的python PIL路徑設定
複製代碼 代碼如下:

[root@lee Imaging-1.1.7]# echo '/usr/local/lib/python2.7/site-packages/PIL' >> /etc/ld.so.conf
[root@lee Imaging-1.1.7]# ldconfig

重新python selftest.py,一路安裝完成

聯繫我們

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