在OS X 10.9上安装PIL - Clang抛出12个错误

时间:2014-04-12 18:56:20

标签: macos clang python-imaging-library

我正在尝试在OS X 10.9上使用pip安装PIL,但遇到了与this person'sthis one'sthis one's和{{3类似的问题}}。我已经简要地尝试了这些问题的答案中提到的每一个解决方案,以及它们的几种组合,但我仍然从Clang那里得到 12个错误

In file included from _imaging.c:76:

In file included from /System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/Python.h:58:

In file included from /System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/pyport.h:351:

In file included from /usr/include/sys/select.h:75:

/usr/include/sys/_types/_fd_def.h:46:16: error: redefinition of '_types_fd_set'

typedef struct fd_set {

               ^

/opt/local/arm-none-eabi/include/sys/types.h:235:16: note: expanded from macro 'fd_set'

#define fd_set _types_fd_set

               ^

/opt/local/arm-none-eabi/include/sys/types.h:231:16: note: previous definition is here

typedef struct _types_fd_set {

               ^

In file included from _imaging.c:76:

In file included from /System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/Python.h:58:

In file included from /System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/pyport.h:351:

In file included from /usr/include/sys/select.h:75:

/usr/include/sys/_types/_fd_def.h:48:3: error: typedef redefinition with different types ('struct _types_fd_set' (aka '_types_fd_set') vs 'struct _types_fd_set')

} fd_set;

  ^

/opt/local/arm-none-eabi/include/sys/types.h:235:16: note: expanded from macro 'fd_set'

#define fd_set _types_fd_set

               ^

/opt/local/arm-none-eabi/include/sys/types.h:233:3: note: previous definition is here

} _types_fd_set;

  ^

In file included from _imaging.c:76:

In file included from /System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/Python.h:58:

In file included from /System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/pyport.h:351:

In file included from /usr/include/sys/select.h:76:

/usr/include/sys/_types/_timespec.h:30:1: error: redefinition of 'timespec'

_STRUCT_TIMESPEC

^

/usr/include/sys/_types/_timespec.h:29:33: note: expanded from macro '_STRUCT_TIMESPEC'

#define _STRUCT_TIMESPEC        struct timespec

                                       ^

/opt/local/arm-none-eabi/include/sys/types.h:115:8: note: previous definition is here

struct timespec {

       ^

In file included from _imaging.c:76:

In file included from /System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/Python.h:58:

In file included from /System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/pyport.h:351:

In file included from /usr/include/sys/select.h:76:

/usr/include/sys/_types/_timespec.h:32:2: error: unknown type name '__darwin_time_t'

        __darwin_time_t tv_sec;

        ^

In file included from _imaging.c:76:

In file included from /System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/Python.h:58:

In file included from /System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/pyport.h:351:

In file included from /usr/include/sys/select.h:77:

/usr/include/sys/_types/_timeval.h:30:1: error: redefinition of 'timeval'

_STRUCT_TIMEVAL

^

/usr/include/sys/_types/_timeval.h:29:33: note: expanded from macro '_STRUCT_TIMEVAL'

#define _STRUCT_TIMEVAL         struct timeval

                                       ^

/opt/local/arm-none-eabi/include/sys/time.h:17:8: note: previous definition is here

struct timeval {

       ^

In file included from _imaging.c:76:

In file included from /System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/Python.h:58:

In file included from /System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/pyport.h:351:

In file included from /usr/include/sys/select.h:77:

/usr/include/sys/_types/_timeval.h:32:2: error: unknown type name '__darwin_time_t'

        __darwin_time_t         tv_sec;         /* seconds */

        ^

/usr/include/sys/_types/_timeval.h:33:2: error: unknown type name '__darwin_suseconds_t'

        __darwin_suseconds_t    tv_usec;        /* and microseconds */

        ^

In file included from _imaging.c:76:

In file included from /System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/Python.h:58:

In file included from /System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/pyport.h:351:

In file included from /usr/include/sys/select.h:84:

/usr/include/sys/_types/_time_t.h:30:9: error: unknown type name '__darwin_time_t'

typedef __darwin_time_t         time_t;

        ^

In file included from _imaging.c:76:

In file included from /System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/Python.h:58:

In file included from /System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/pyport.h:351:

In file included from /usr/include/sys/select.h:85:

/usr/include/sys/_types/_suseconds_t.h:30:9: error: unknown type name '__darwin_suseconds_t'

typedef __darwin_suseconds_t    suseconds_t;

        ^

In file included from _imaging.c:76:

In file included from /System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/Python.h:58:

In file included from /System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/pyport.h:351:

In file included from /usr/include/sys/select.h:86:

/usr/include/sys/_types/_sigset_t.h:30:9: error: unknown type name '__darwin_sigset_t'

typedef __darwin_sigset_t               sigset_t;

        ^

In file included from _imaging.c:76:

In file included from /System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/Python.h:58:

In file included from /System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/pyport.h:351:

/usr/include/sys/select.h:118:3: error: expected function body after function declarator

                __DARWIN_EXTSN_C(pselect)

                ^

In file included from _imaging.c:76:

In file included from /System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/Python.h:58:

In file included from /System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/pyport.h:351:

In file included from /usr/include/sys/select.h:129:

/usr/include/sys/_select.h:42:3: error: expected function body after function declarator

                __DARWIN_EXTSN_C(select)

                ^

12 errors generated.

error: command 'cc' failed with exit status 1

我正在使用pip 1.4.1,python 2.7.5和clang 3.4与llvm 5.1。

我可以尝试在那些答案中没有提到任何内容吗?还有其他人有过类似的问题吗?

1 个答案:

答案 0 :(得分:0)

尝试使用此命令安装PIL:

ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future pip install pil


更多信息:

我遇到了与您链接的一些问题完全相同的错误(特别是第一个this one's)。这个解决方案对我有用。

我了解到Xcode 5.1附带的编译器会将未知传递的参数视为错误。

此命令告诉它在安装PIL时忽略这些“错误”。

来源:http://bruteforce.gr/bypassing-clang-error-unknown-argument.html