Python安裝Imaging報(bào)錯(cuò):The _imaging C module is not installed問(wèn)題解決方法
更新時(shí)間:2014年08月22日 09:45:31 投稿:junjie
這篇文章主要介紹了Python安裝Imaging報(bào)錯(cuò):The _imaging C module is not installed問(wèn)題解決方法,原來(lái)是PIL庫(kù)的庫(kù)文件沒有加到系統(tǒng)中導(dǎo)致老是提示這個(gè)錯(cuò)誤,需要的朋友可以參考下
今天寫Python程序上傳圖片需要用到PIL庫(kù),于是到http://www.pythonware.com/products/pil/#pil117下載了一個(gè)1.1.7版本的,我用的是CentOS64 并且自行升級(jí)后的Python版本安裝PIL庫(kù)
首先下載解壓:
復(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
都沒問(wèn)題,當(dāng)測(cè)試安裝的時(shí)候卻老提示:*** The _imaging C module is not installed
復(fù)制代碼 代碼如下:
[root@lee Imaging-1.1.7]# python selftest.py
*** The _imaging C module is not installed
找了半天,也找不出是什么原因,后來(lái)終于在官網(wǎng)從一堆英文中找到了關(guān)鍵所在,解決方法,實(shí)際根據(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,一路安裝完成
您可能感興趣的文章:
- Python運(yùn)行報(bào)錯(cuò)UnicodeDecodeError的解決方法
- Python首次安裝后運(yùn)行報(bào)錯(cuò)(0xc000007b)的解決方法
- 解決Python requests 報(bào)錯(cuò)方法集錦
- 解決Python中字符串和數(shù)字拼接報(bào)錯(cuò)的方法
- Python處理JSON時(shí)的值報(bào)錯(cuò)及編碼報(bào)錯(cuò)的兩則解決實(shí)錄
- 完美解決python遍歷刪除字典里值為空的元素報(bào)錯(cuò)問(wèn)題
- 解決python3 urllib中urlopen報(bào)錯(cuò)的問(wèn)題
- Python 使用os.remove刪除文件夾時(shí)報(bào)錯(cuò)的解決方法
- python中異常報(bào)錯(cuò)處理方法匯總
- 新手常見6種的python報(bào)錯(cuò)及解決方法
相關(guān)文章
Python實(shí)現(xiàn)打包成庫(kù)供別的模塊調(diào)用
這篇文章主要介紹了Python實(shí)現(xiàn)打包成庫(kù)供別的模塊調(diào)用,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。一起跟隨小編過(guò)來(lái)看看吧2020-07-07在Python下利用OpenCV來(lái)旋轉(zhuǎn)圖像的教程
這篇文章主要介紹了在Python下利用OpenCV來(lái)旋轉(zhuǎn)圖像的教程,代碼和核心的算法都非常簡(jiǎn)單,需要的朋友可以參考下2015-04-04