1

一直在尝试按照此处的说明在 Mountain Lion OSX 机器上安装我的 Python 3 安装 lxml:http: //lxml.de/build.html#building-lxml-on-macos-x

运行后出现以下错误python3 setup.py build --static-deps

编辑:编辑了我收到的错误消息。下面只有尾行,因为它很长。)

   ..
config.status: executing depfiles commands
config.status: executing libtool commands
rm: libtoolT: No such file or directory
make  all-recursive
Making all in libxslt
/bin/sh ../libtool --tag=CC   --mode=compile cc -DHAVE_CONFIG_H -I. -I.. -I.. -I../libxslt -I/Users/Salem/Desktop/lxml-2.3.5/build/tmp/libxml2/include/libxml2 -I/Users/Salem/Desktop/lxml-2.3.5/build/tmp/libxml2/include    -g -O2 -Wall -c -o xsltutils.lo xsltutils.c
/bin/sh ../libtool --tag=CC   --mode=compile cc -DHAVE_CONFIG_H -I. -I.. -I.. -I../libxslt -I/Users/Salem/Desktop/lxml-2.3.5/build/tmp/libxml2/include/libxml2 -I/Users/Salem/Desktop/lxml-2.3.5/build/tmp/libxml2/include    -g -O2 -Wall -c -o security.lo security.c
libtool: compile:  cc -DHAVE_CONFIG_H -I. -I.. -I.. -I../libxslt -I/Users/Salem/Desktop/lxml-2.3.5/build/tmp/libxml2/include/libxml2 -I/Users/Salem/Desktop/lxml-2.3.5/build/tmp/libxml2/include -g -O2 -Wall -c xsltutils.c -o xsltutils.o
libtool: compile:  cc -DHAVE_CONFIG_H -I. -I.. -I.. -I../libxslt -I/Users/Salem/Desktop/lxml-2.3.5/build/tmp/libxml2/include/libxml2 -I/Users/Salem/Desktop/lxml-2.3.5/build/tmp/libxml2/include -g -O2 -Wall -c security.c -o security.o
xsltutils.c:1541:30: warning: incompatible pointer types passing 'xmlBufPtr'
      (aka 'struct _xmlBuf *') to parameter of type 'xmlBufferPtr' (aka
      'struct _xmlBuffer *') [-Wincompatible-pointer-types]
                xmlBufferWriteQuotedString(buf->buffer, result->version);
                                           ^~~~~~~~~~~
/Users/Salem/Desktop/lxml-2.3.5/build/tmp/libxml2/include/libxml2/libxml/tree.h:1122:43: note: 
      passing argument to parameter 'buf' here
                xmlBufferWriteQuotedString(xmlBufferPtr buf,
                                                        ^
xsltutils.c:1554:30: warning: incompatible pointer types passing 'xmlBufPtr'
      (aka 'struct _xmlBuf *') to parameter of type 'xmlBufferPtr' (aka
      'struct _xmlBuffer *') [-Wincompatible-pointer-types]
                xmlBufferWriteQuotedString(buf->buffer, (xmlChar *) encoding);
                                           ^~~~~~~~~~~
/Users/Salem/Desktop/lxml-2.3.5/build/tmp/libxml2/include/libxml2/libxml/tree.h:1122:43: note: 
      passing argument to parameter 'buf' here
                xmlBufferWriteQuotedString(xmlBufferPtr buf,
                                                        ^
xsltutils.c:1758:26: error: incomplete definition of type 'struct _xmlBuf'
        *doc_txt_len = buf->conv->use;
                       ~~~~~~~~~^
/Users/Salem/Desktop/lxml-2.3.5/build/tmp/libxml2/include/libxml2/libxml/tree.h:104:16: note: 
      forward declaration of 'struct _xmlBuf'
typedef struct _xmlBuf xmlBuf;
               ^
xsltutils.c:1759:37: error: incomplete definition of type 'struct _xmlBuf'
        *doc_txt_ptr = xmlStrndup(buf->conv->content, *doc_txt_len);
                                  ~~~~~~~~~^
/Users/Salem/Desktop/lxml-2.3.5/build/tmp/libxml2/include/libxml2/libxml/tree.h:104:16: note: 
      forward declaration of 'struct _xmlBuf'
typedef struct _xmlBuf xmlBuf;
               ^
xsltutils.c:1761:28: error: incomplete definition of type 'struct _xmlBuf'
        *doc_txt_len = buf->buffer->use;
                       ~~~~~~~~~~~^
/Users/Salem/Desktop/lxml-2.3.5/build/tmp/libxml2/include/libxml2/libxml/tree.h:104:16: note: 
      forward declaration of 'struct _xmlBuf'
typedef struct _xmlBuf xmlBuf;
               ^
xsltutils.c:1762:39: error: incomplete definition of type 'struct _xmlBuf'
        *doc_txt_ptr = xmlStrndup(buf->buffer->content, *doc_txt_len);
                                  ~~~~~~~~~~~^
/Users/Salem/Desktop/lxml-2.3.5/build/tmp/libxml2/include/libxml2/libxml/tree.h:104:16: note: 
      forward declaration of 'struct _xmlBuf'
typedef struct _xmlBuf xmlBuf;
               ^
2 warnings and 4 errors generated.
make[2]: *** [xsltutils.lo] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
Traceback (most recent call last):
  File "setup.py", line 233, in <module>
    **setup_extra_options()
  File "setup.py", line 145, in setup_extra_options
    STATIC_CFLAGS, STATIC_BINARIES)
  File "/Users/Salem/Desktop/lxml-2.3.5/setupinfo.py", line 56, in ext_modules
    multicore=OPTION_MULTICORE)
  File "/Users/Salem/Desktop/lxml-2.3.5/buildlibxml.py", line 335, in build_libxml2xslt
    cmmi(libxslt_configure_cmd, libxslt_dir, multicore, **call_setup)
  File "/Users/Salem/Desktop/lxml-2.3.5/buildlibxml.py", line 266, in cmmi
    cwd=build_dir, **call_setup)
  File "/Users/Salem/Desktop/lxml-2.3.5/buildlibxml.py", line 249, in call_subprocess
    raise Exception('Command "%s" returned code %s' % (cmd_desc, returncode))
Exception: Command "make -j5" returned code 512
4

1 回答 1

0

你可以看到错误:checking whether the C compiler works... no

转到 xcode 并安装“命令行工具”

它位于“Xcode / Preferences / Downloads”下

如果您没有 Xcode,请先从 App Store 获取。

于 2012-08-20T19:02:40.127 回答