kateli1991

在Mac OSX 10.6上安装Python 2.7映像模块时出错



我正在尝试安装scikits.images公司以及雪豹上的python2.7.1上的Imaging-1.1.7(来自Python图像库)。我已经安装了Numpy和Scipy。我只需要一些方法来可视化一个像素数据数组following this example,但我一直收到如下安装错误。在

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

$ 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,因为我在某个地方读到了需要它的地方,但我在运行时遇到了同样的错误。”设置.py在Cython文件夹中安装。我不知道怎么从这里开始。。。任何帮助都将不胜感激,谢谢!在

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

好吧,这真的很糟糕,但我一辈子都不能让它在我的Mac电脑上运行。最后我借用了一台Windows机器,把它安装在上面,它在那里工作。喝倒采。在


已被浏览了14951次
6 日,21 小时 之前提问
3 个回答
fefe Tyson

在Maverick中,运行以下命令有助于

sudo ln -s /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include/ /usr/include
评论 - 2020年7月29日 15:39
fefe Tyson

你检查过这个文件是否存在吗?在

/Developer old/usr/lib/gcc/i686-apple-darwin10/4.0.1/include/limits.h

评论 - 2020年7月29日 15:39
fefe Tyson

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

为我工作。在

评论 - 2020年7月29日 15:39

最新Python问答

推荐Python问答