python - 在 Mac OSX 10.6 上安装 Python 2.7 成像模块时出错

标签 python gcc installation scipy

我正在尝试在 Snow Leopard 的 Python 2.7.1 上安装 scikits.images 和 Imaging-1.1.7(来自 Python Imaging Library)。我已经安装了 Numpy 和 Scipy。我只需要某种方法来可视化像素数据数组 following this example ,但我不断收到如下安装错误。

我的 gcc-4.0 文件位于/Developer-old/usr/bin 中,但我将/usr/bin/gcc-4.0 符号链接(symbolic link)到该目录。

$ python setup.py install
running install
running build
running build_py
running build_ext
--- using frameworks at /System/Library/Frameworks
building '_imaging' extension
gcc-4.0 -fno-strict-aliasing -fno-common -dynamic -arch ppc -arch i386 -g -O2 -DNDEBUG -g -O3 -IlibImaging -I/Library/Frameworks/Python.framework/Versions/2.7/include -I/usr/local/include -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c _imaging.c -o build/temp.macosx-10.3-fat-2.7/_imaging.o
In file included from /Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/Python.h:19,
                 from _imaging.c:75:
/Developer-old/usr/bin/../lib/gcc/i686-apple-darwin10/4.0.1/include/limits.h:10:25: error: limits.h: No such file or directory
In file included from _imaging.c:75:
/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/Python.h:33:19: error: stdio.h: No such file or directory
/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/Python.h:35:5: error: #error "Python.h requires that stdio.h define NULL."
/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/Python.h:38:20: error: string.h: No such file or directory
/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/Python.h:40:19: error: errno.h: No such file or directory
/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/Python.h:42:20: error: stdlib.h: No such file or directory
/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/Python.h:44:20: error: unistd.h: No such file or directory
/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/Python.h:56:20: error: assert.h: No such file or directory
In file included from /Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/Python.h:58,
                 from _imaging.c:75:
/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/pyport.h:9:22: error: inttypes.h: No such file or directory
In file included from /Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/Python.h:58,
                 from _imaging.c:75:
/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/pyport.h:170: error: syntax error before ‘Py_ssize_t’
...
...
and so on
...
...
_imaging.c:3147: warning: data definition has no type or storage class
_imaging.c:3149: error: syntax error before ‘*’ token
_imaging.c:3149: error: syntax error before ‘*’ token
_imaging.c:3149: warning: data definition has no type or storage class
_imaging.c:3150: error: syntax error before ‘*’ token
_imaging.c:3150: error: syntax error before ‘*’ token
_imaging.c:3150: warning: data definition has no type or storage class
_imaging.c:3152: error: array type has incomplete element type
_imaging.c:3155: error: syntax error before ‘_blend’
_imaging.c:3156: error: syntax error before ‘_fill’
_imaging.c:3157: error: syntax error before ‘_new’
_imaging.c:3159: error: syntax error before ‘_getcount’
_imaging.c:3162: error: syntax error before ‘_convert2’
_imaging.c:3163: error: syntax error before ‘_copy2’
_imaging.c:3166: error: syntax error before ‘PyImaging_BitDecoderNew’
_imaging.c:3167: error: syntax error before ‘PyImaging_EpsEncoderNew’
_imaging.c:3168: error: syntax error before ‘PyImaging_FliDecoderNew’
_imaging.c:3169: error: syntax error before ‘PyImaging_GifDecoderNew’
_imaging.c:3170: error: syntax error before ‘PyImaging_GifEncoderNew’
_imaging.c:3171: error: syntax error before ‘PyImaging_HexDecoderNew’
_imaging.c:3172: error: syntax error before ‘PyImaging_EpsEncoderNew’
_imaging.c:3177: error: syntax error before ‘PyImaging_TiffLzwDecoderNew’
_imaging.c:3178: error: syntax error before ‘PyImaging_MspDecoderNew’
_imaging.c:3179: error: syntax error before ‘PyImaging_PackbitsDecoderNew’
_imaging.c:3180: error: syntax error before ‘PyImaging_PcdDecoderNew’
_imaging.c:3181: error: syntax error before ‘PyImaging_PcxDecoderNew’
_imaging.c:3182: error: syntax error before ‘PyImaging_PcxEncoderNew’
...
...
lipo: can't figure out the architecture type of:   /var/folders/Mk/MkDxFxURFZmLg+gkCGdO9U+++TM/-Tmp-//ccsfzTIz.out
error: command 'gcc-4.0' failed with exit status 1

我只是缺少一些 C 头文件吗?我还尝试安装 Cython,因为我在某处读到我需要它,但在尝试在 Cython 文件夹中运行“setup.py install”时遇到相同的错误。我不知道如何从这里开始...任何帮助将不胜感激,谢谢!

------------- 更新 ---------------

嗯,这确实很糟糕,但我一生都无法让它在我的 Mac 上运行。我最终借了一台 Windows 机器并将其安装在上面,并且它在那里工作了。嘘。

最佳答案

sudo ln -s /Developer/SDKs/MacOSX10.7.sdk/usr/include/ /usr/include

为我工作。

关于python - 在 Mac OSX 10.6 上安装 Python 2.7 成像模块时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6867031/

相关文章:

python - Flask 每个蓝图错误页面

python - 使用 pd.to_datetime 将字符串日期转换为日期时间格式时出错

python - Flask/Werkzeug 请求对象表单参数

python - 计算特定值的两个二维二进制 numpy 数组的重叠值

c - 从 max 终端编译 c gsl 库时出现问题

bash - Windows 10 的 Linux 子系统中的 apt 失败并显示 404 Not Found

java - 带有安装程序/激活程序的 NetBeans 平台模块。如何强制从对话框发出通知

C - 指向结构体的指针 - 段错误

c - c中相同代码的不同答案

WiX 正确创建桌面快捷方式