【发布时间】:2013-02-01 20:51:00
【问题描述】:
我知道关于 SO 以及网络上的论坛和博客帖子有很多问题,但我一直遇到同样的问题。我正在尝试安装 PIL 以将其用于应用程序引擎映像 api。在api overview 中,google 建议从pythonmac.org 安装。
当我尝试安装那里提供的 dmg 时,它告诉我它需要将 python 2.5 安装为系统 python。针对这个错误进行了一些谷歌搜索,向我指出了这个 SO 问题:How to install PIL on Mac OSX 10.5.8 for Google App Engine?。在第一个答案中,我做了第 1 步,我安装了 macports。然后,第 2 步告诉我运行 sudo port install python25。
这给了我以下错误:
Error: org.macports.activate for port expat returned: Image error: /opt/local/bin/xmlwf already exists and does not belong to a registered port. Unable to activate port expat. Use 'port -f activate expat' to force the activation.
Error: Failed to install expat
Please see the log file for port expat for details:
/opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_textproc_expat/expat/main.log
Error: The following dependencies were not installed: gettext expat libiconv ncurses libedit openssl zlib python_select sqlite3
To report a bug, follow the instructions in the guide:
http://guide.macports.org/#project.tickets
Error: Processing of port python25 failed
macports的完整输出见this pastebin
如果没有成功,我在谷歌上搜索了一下,把我带到了this blog post。正如它所建议的那样,我安装了 libjpeg。它建议的以下步骤是:
从http://effbot.org/downloads/Imaging-1.1.7.tar.gz 下载 PIL。 (如果已安装,请先删除 PIL。)
在解压后的文件夹中: python setup.py build --force sudo python setup.py install
但是当我尝试运行 python setup.py build --force 时,我得到了这个错误:
_imaging.c:3017: warning: initialization from incompatible pointer type
_imaging.c:3077: warning: initialization from incompatible pointer type
lipo: can't figure out the architecture type of: /var/folders/q_/wgr019b53rx9b2lr3y7867bm0000gn/T//ccJY6hPI.out
error: command 'gcc-4.2' failed with exit status 1
如需完整输出,请查看this pastebin。
我还尝试了其他一些东西,我会在其中进行编辑,但我想尽快发布。 提前谢谢。
【问题讨论】:
标签: python installation python-imaging-library osx-mountain-lion