python Image模組安裝

來源:互聯網
上載者:User

標籤:python

我的系統是mac os x yosemite 10.10

一、下載源碼包

http://www.pythonware.com/products/pil/index.htm   下載最新版的PIL安裝程式 ,我下載的是tar xfz Imaging-1.1.7.tar.gz

http://www.ijg.org  最新的版本是jpegsrc.v9a.tar.gz,安裝jpeg庫

http://www.gzip.org/zlib/ 下載zlib-1.2.8.tar.gz支援壓縮功能的zlib庫

二、安裝

1.解壓jpegsrc.v9a.tar.gz
cd jpeg-9a
./configure && make && make test && make install

2.解壓 zlib-1.2.8.tar.gz
  cd zlib-1.2.8
./configure && make && make install

3.解壓xfz Imaging-1.1.7.tar.gz
  cd Imaging-1.1.7
python setup.py build_ext -i
我的安裝到這裡出現了問題:

/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/usr/include/tk.h:78:11: fatal error:       'X11/Xlib.h' file not found#       include <X11/Xlib.h>                ^

找到解決方案如下:
首先我用mac 的 spotlight看了下,系統裡確實沒有Xlib.h檔案。
到這裡http://xquartz.macosforge.org/landing/下載XQuartz-2.7.7.dmg正常安裝。
接下來在終端輸入

sudo ln -s /opt/X11/include/X11 /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/usr/include/

?:MacOSX10.10.sdk 這裡的版本號碼就是上面報錯提示的版本號碼,不要盲目複製。。。搞定後重新開始python setup.py build_ext -ipython setup.py build

  sudo python setup.py install    (ps:這裡sudo 不然許可權不夠)

整個過程就完成了!!!!


參考:http://blog.163.com/[email protected]/blog/static/173612348201193112324679/

http://stackoverflow.com/questions/14321038/x11-xlib-h-no-such-file-or-directory-on-mac-os-x-mountain-lion


著作權聲明:本文為博主原創文章,未經博主允許不得轉載。

python Image模組安裝

聯繫我們

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