Mac OS系統上安裝Python的Pillow庫的教程
1. 安裝pip
sudo easy_install pip
pip 安裝成功就可以直接安裝pil或者pillow
2. 通過命令pip install pil
pip install Pil
Downloading/unpacking Pil Could not find any downloads that satisfy the requirement Pil Some externally hosted files were ignored (use --allow-external Pil to allow). Cleaning up... No distributions at all found for Pil Storing debug log for failure in /Users/macbook/Library/Logs/
3. 所以就安裝pillow
pip install --use-wheel Pillow
Downloading/unpacking Pillow Downloading (6.5MB): 5.0MB downloaded Cleaning up...
弄了會別的'回來發現還沒有下載完,這叫一個慢呀,於是放棄
4. Git
通過git下載源碼地址
git clone
然後開始編譯安裝
4.1
python build_ext -i
編譯完之後會提示運行測試例子,並且發現JPEG support not available
-------------------------------------------------------------------- version Pillow 2.4.0 platform darwin 2.7.5 (default, Aug 25 2013, 00:04:04) [GCC 4.2.1 Compatible Apple LLVM 5.0 (clang-500.0.68)] -------------------------------------------------------------------- --- TKINTER support available *** JPEG support not available *** OPENJPEG (JPEG2000) support not available --- ZLIB (PNG/ZIP) support available *** LIBTIFF support not available --- FREETYPE2 support available *** LITTLECMS2 support not available *** WEBP support not available *** WEBPMUX support not available -------------------------------------------------------------------- To add a missing option, make sure you have the required library, and set the corresponding ROOT variable in the script. To check the build, run the script.
4.2 因為JPEG support not available,運行python 報告錯誤
1 tests of 57 failed.
於是只好卸載pillow
可以通過pip命令來卸載
pip uninstall pillow sudo pip uninstall pillow
Password: Uninstalling Pillow: /Library/Python/2.7/site-packages/ /usr/local/bin/ /usr/local/bin/ /usr/local/bin/ /usr/local/bin/ /usr/local/bin/ Proceed (y/n)? y
成功之後需要安裝libjpeg的支持
brew install libjpeg
安裝成功之後重新編譯pillow
-------------------------------------------------------------------- version Pillow 2.4.0 platform darwin 2.7.5 (default, Aug 25 2013, 00:04:04) [GCC 4.2.1 Compatible Apple LLVM 5.0 (clang-500.0.68)] -------------------------------------------------------------------- --- TKINTER support available --- JPEG support available *** OPENJPEG (JPEG2000) support not available --- ZLIB (PNG/ZIP) support available *** LIBTIFF support not available --- FREETYPE2 support available *** LITTLECMS2 support not available *** WEBP support not available *** WEBPMUX support not available -------------------------------------------------------------------- python -------------------------------------------------------------------- Pillow 2.4.0 TEST SUMMARY -------------------------------------------------------------------- Python modules loaded from /Users/macbook/yyang/app-devel-source/python/Pillow/PIL Binary modules loaded from /Users/macbook/yyang/app-devel-source/python/Pillow/PIL -------------------------------------------------------------------- --- PIL CORE support ok --- TKINTER support ok --- JPEG support ok *** JPEG 2000 support not installed --- ZLIB (PNG/ZIP) support ok *** LIBTIFF support not installed --- FREETYPE2 support ok *** LITTLECMS2 support not installed *** WEBP support not installed -------------------------------------------------------------------- Running selftest: --- 57 tests passed.
最後執行安裝
sudo python install
相關文章
-
MacBook Pro with Retina display 不適合做網頁設計嗎?
新買的MBPR 15‘ ,樂了兩天,亂七八糟軟件裝好,win7裝好(為了做web設計看兼容性)開始幹活的時候。。。。傻眼了1,看一般的網站,上面的圖片根本沒法直視啊啊啊,各種虛各種朦朧,本人偏執狂,看東西和做圖都以像素為單位的,以前做的一 -
解析cpu power limit control 主機BOIS裏的配置經驗
以下是來自本人親自的實戰文章,如果你眼前出現了cpu power limit control這樣的字符,那必定是在BIOS裏設置的時候出現的,路徑一般在BIOS界面的PowerManagement setup選項中,打開後有一項PowerManagement setup,默認是開啟 -
關於暑假計劃英語作文:Plan for the Coming Summer Holiday
Inthe coming summer holiday, I am going to do a lot of interesting things.在即將到來的'暑假,我打算做很多有趣的事情。First, I will finish my holiday homework. Second, I am going tohave a good rest. I a -
Could you tell me how to get to the National Stadium ?評課稿大綱
一年一度的校田徑運動會正是宣傳體育健身,加強學生體育鍛煉的契機。下面是本站小編給大家整理的田徑運動會開幕式致辭範文,僅供參考。田徑運動會開幕式致辭範文篇1各位領導、全體運動員、裁判員、老師們、同學們:在這秋 -
i recall with embarrassing clarity the flavor of those particular ashes ?
on slef-respect Joan Didion如何翻譯Although now,some years later,I marvel that a mind on the outs with itself should have nonetheless made painstaking record of its every tremor,I recall with embarras -
冀教版英語《Tomorrow We Will Work and Play》教學設計範文
寶寶的健康發展時刻牽動着父母的心絃。對於父母來説,尤其是剛為人父母的新手爸爸和新手媽咪們來説。因為之前沒有經驗,所以更加的小心翼翼,深怕一個不留神,就耽誤了孩子,也錯過了寶寶成長中美好的點滴。比起女孩子,男寶寶更 -
以HappyPrimarySchoolLife為題的英語作文
Happy Primary School LifeMy name is Daisy, I have a happy and full primary school life. I normally get up at half past six in the moing to go school from Monday to Friday. When I get to school, I do t -
葡萄牙語的歷史:Revolucionários apossam-se de Porto Alegre
No dia seguinte, os revolucionários penetraram na cidade sem encontrar oposi??o. O Corpo de Permanentes aderiu logo ao movimento, com exce??o do comandante, do subcomandante, de um cabo, de um soldad -
七年級英語下冊What time do you go to school?評課稿
李老師的這一堂課,充分考慮了七年級學生的學習規律,打破傳統的教學思路,使課堂避免了枯燥乏味,大膽實踐,把重點放在單詞的運用過程中,充分培養了學生的綜合語言運用能力。主要有以下幾點體會: 1、以教材為基本,但又不拘泥於 -
教材三年級起點第三冊Module8 Sports Day Unit1 What are you going to do
教材分析本單元是外研版教材三年級起點四年級上冊第八模塊《 Sports Day》第一單元的內容。本單元中,老師宣佈學校將舉行運動會,Sam問Daming將會參加什麼項目,從而引出重點句型“ Whatareyou going to do ?I’m going to