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
-
Win8主題包deskthemepack的安裝教程詳解
在WindowsXP和Windows7時代,使用豐富多彩的'主題是Windows用户的一個顯著特徵。Win8也能更換主題,themepack就是Win8的專用主題包格式。但有時候雙擊這一格式主題包,卻顯示themepack無效。怎麼辦呢?解決方法需要將區域改成日本才能安裝,裝上之後再改回來即可。首...
-
千紙鶴的折法步驟教程
千紙鶴的折法步驟有哪些呢?我們不妨一去來參考下吧!以下是小編為大家蒐集整理提供到的千紙鶴的折法步驟教程,希望對您有所幫助。歡迎閲讀參考學習!工具/原料紙方法/步驟第一步:張正方形的紙,橫折一次,豎折一次,對角各折一次,這樣留下一個“米”字形的摺痕,方便下一個步驟...
-
ServerGuide 如何安裝指南教程
使用ServerGuide設置和安裝CD時,您不需要安裝軟盤。可以使用CD配置任何支持的IBM服務器型號。安裝程序提供了安裝服務器型號所需要的任務列表。在裝有ServeRAID適配器或具有RAID能力的集成SCSI控制器的服務器上,您可以運行SCSIRAID配置程序來創建邏輯驅動器。注:S...
-
關於電力貓安裝的教程
此前為大家分享過“路由器怎麼連接菜鳥必看的路由器安裝示意圖”的文章,今天小編以家中的電力貓為例,分享一下電力貓怎麼安裝。儘管電力貓與路由器功能相當,設置也大同小異,但是連接安裝還是有較大的'區別,尤其是電力貓經常需要與擴展器進行對碼配對,這是路由器所沒...
相關文章
- 以HappyPrimarySchoolLife為題的英語作文
- 教材三年級起點第三冊Module8 Sports Day Unit1 What are you going to do
- 解析cpu power limit control 主機BOIS裏的配置經驗
- 關於暑假計劃英語作文:Plan for the Coming Summer Holiday
- 葡萄牙語的歷史:Revolucionários apossam-se de Porto Alegre
- 七年級英語下冊What time do you go to school?評課稿
- 冀教版英語《Tomorrow We Will Work and Play》教學設計範文
- Could you tell me how to get to the National Stadium ?評課稿大綱
- i recall with embarrassing clarity the flavor of those particular ashes ?
- MacBook Pro with Retina display 不適合做網頁設計嗎?