Python安裝Imaging報錯:The _imaging C module is not installed問題解決方法
更新時間:2014年08月22日 09:45:31 投稿:junjie
這篇文章主要介紹了Python安裝Imaging報錯:The _imaging C module is not installed問題解決方法,原來是PIL庫的庫文件沒有加到系統(tǒng)中導(dǎo)致老是提示這個錯誤,需要的朋友可以參考下
今天寫Python程序上傳圖片需要用到PIL庫,于是到http://www.pythonware.com/products/pil/#pil117下載了一個1.1.7版本的,我用的是CentOS64 并且自行升級后的Python版本安裝PIL庫
首先下載解壓:
復(fù)制代碼 代碼如下:
[root@lee ~]# wget http://www.pythonware.com/products/pil/#pil117
[root@lee ~]# tar -xf Imaging-1.1.7.tar.gz
然后準(zhǔn)備安裝
復(fù)制代碼 代碼如下:
[root@lee ~]# cd Imaging-1.1.7
[root@lee Imaging-1.1.7]# python python setup.py build_ext -i
都沒問題,當(dāng)測試安裝的時候卻老提示:*** The _imaging C module is not installed
復(fù)制代碼 代碼如下:
[root@lee Imaging-1.1.7]# python selftest.py
*** The _imaging C module is not installed
找了半天,也找不出是什么原因,后來終于在官網(wǎng)從一堆英文中找到了關(guān)鍵所在,解決方法,實際根據(jù)自己的python PIL路徑設(shè)置
復(fù)制代碼 代碼如下:
[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,一路安裝完成
相關(guān)文章
Python實現(xiàn)打包成庫供別的模塊調(diào)用
這篇文章主要介紹了Python實現(xiàn)打包成庫供別的模塊調(diào)用,具有很好的參考價值,希望對大家有所幫助。一起跟隨小編過來看看吧2020-07-07在Python下利用OpenCV來旋轉(zhuǎn)圖像的教程
這篇文章主要介紹了在Python下利用OpenCV來旋轉(zhuǎn)圖像的教程,代碼和核心的算法都非常簡單,需要的朋友可以參考下2015-04-04