python安裝模塊,python image模塊需要安裝嗎_python Image模塊安裝

 2023-10-02 阅读 28 评论 0

摘要:我的系統是mac osx yosemite 10.10一、下載源碼包python安裝模塊。http://www.pythonware.com/products/pil/index.htm???下載最新版的PIL安裝程序 ,我下載的是tar xfz Imaging-1.1.7.tar.gzhttp://www.ijg.org? 最新的版本是jpegsrc.v9a.tar.gz,安裝jpeg庫http

我的系統是mac osx yosemite 10.10

一、下載源碼包

python安裝模塊。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庫

python導入圖片?二、安裝

1.解壓jpegsrc.v9a.tar.gz

cd jpeg-9a

python菜鳥教程、./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 ^

找到解決方案如下:

首先我用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 -i

python setup.py build

sudo python setup.py install ? ?(ps:這里sudo 不然權限不夠)

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

參考:http://blog.163.com/longsu2010@yeah/blog/static/173612348201193112324679/

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

版权声明:本站所有资料均为网友推荐收集整理而来,仅供学习和研究交流使用。

原文链接:https://hbdhgg.com/5/109799.html

发表评论:

本站为非赢利网站,部分文章来源或改编自互联网及其他公众平台,主要目的在于分享信息,版权归原作者所有,内容仅供读者参考,如有侵权请联系我们删除!

Copyright © 2022 匯編語言學習筆記 Inc. 保留所有权利。

底部版权信息