今天寫Python程序上傳圖片需要用到PIL庫,于是到http://www.pythonware.com/products/pil/#pil117下載了一個(gè)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)測試安裝的時(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
找了半天,也找不出是什么原因,后來終于在官網(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,一路安裝完成
更多文章、技術(shù)交流、商務(wù)合作、聯(lián)系博主
微信掃碼或搜索:z360901061

微信掃一掃加我為好友
QQ號聯(lián)系: 360901061
您的支持是博主寫作最大的動(dòng)力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描下面二維碼支持博主2元、5元、10元、20元等您想捐的金額吧,狠狠點(diǎn)擊下面給點(diǎn)支持吧,站長非常感激您!手機(jī)微信長按不能支付解決辦法:請將微信支付二維碼保存到相冊,切換到微信,然后點(diǎn)擊微信右上角掃一掃功能,選擇支付二維碼完成支付。
【本文對您有幫助就好】元
