Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/macos/8.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 在os x 10.5上轻松安装lxml_Python_Macos_Installation_Lxml_Easy Install - Fatal编程技术网

Python 在os x 10.5上轻松安装lxml

Python 在os x 10.5上轻松安装lxml,python,macos,installation,lxml,easy-install,Python,Macos,Installation,Lxml,Easy Install,我正在尝试在我的计算机上安装lxml,但遇到了困难。有人能帮忙吗?我已经提供了当我尝试执行“easy_install lxml”时得到的终端输出。我正在运行MacOSX10.5和Python版本2.7.2。谢谢 Macintosh-8:~ momdad$ easy_install lxml Searching for lxml Reading http://pypi.python.org/simple/lxml/ Reading http://codespeak.net/lxml Best ma

我正在尝试在我的计算机上安装lxml,但遇到了困难。有人能帮忙吗?我已经提供了当我尝试执行“easy_install lxml”时得到的终端输出。我正在运行MacOSX10.5和Python版本2.7.2。谢谢

Macintosh-8:~ momdad$ easy_install lxml
Searching for lxml
Reading http://pypi.python.org/simple/lxml/
Reading http://codespeak.net/lxml
Best match: lxml 2.3.3
Downloading http://lxml.de/files/lxml-2.3.3.tgz
Processing lxml-2.3.3.tgz
Running lxml-2.3.3/setup.py -q bdist_egg --dist-dir /var/folders/NA/NA4jZIQeGBihRLry0Fm6v++++TI/-Tmp-/easy_install-CAOPgi/lxml-2.3.3/egg-dist-tmp-SOj-c0
Building lxml version 2.3.3.
Building without Cython.
Using build configuration of libxslt 1.1.12
Building against libxml2/libxslt in the following directory: /usr/lib
src/lxml/lxml.etree.c:276:31: error: libxml/schematron.h: No such file or directory
src/lxml/lxml.etree.c:276:31: error: libxml/schematron.h: No such file or directory
src/lxml/lxml.etree.c:2007: error: syntax error before ‘xmlSchemaSAXPlugStruct’
src/lxml/lxml.etree.c:2009: error: syntax error before ‘}’ token
src/lxml/lxml.etree.c:2007: error: syntax error before ‘xmlSchemaSAXPlugStruct’
src/lxml/lxml.etree.c:2009: error: syntax error before ‘}’ token
src/lxml/lxml.etree.c: In function ‘__pyx_pf_4lxml_5etree_14_ParserContext_1__dealloc__’:
src/lxml/lxml.etree.c:73868: error: dereferencing pointer to incomplete type
src/lxml/lxml.etree.c: In function ‘__pyx_f_4lxml_5etree_14_ParserContext__copy’:
src/lxml/lxml.etree.c:73962: error: dereferencing pointer to incomplete type
src/lxml/lxml.etree.c: In function ‘__pyx_f_4lxml_5etree_14_ParserContext_prepare’:
src/lxml/lxml.etree.c:74266: error: dereferencing pointer to incomplete type
src/lxml/lxml.etree.c: In function ‘__pyx_f_4lxml_5etree_14_ParserContext_cleanup’:
src/lxml/lxml.etree.c:74324: error: dereferencing pointer to incomplete type
src/lxml/lxml.etree.c: In function ‘__pyx_f_4lxml_5etree__handleParseResult’:
src/lxml/lxml.etree.c:75040: error: dereferencing pointer to incomplete type
src/lxml/lxml.etree.c:75481: error: dereferencing pointer to incomplete type
src/lxml/lxml.etree.c:75494: error: dereferencing pointer to incomplete type
src/lxml/lxml.etree.c: In function ‘__pyx_pf_4lxml_5etree_14_ParserContext_1__dealloc__’:
src/lxml/lxml.etree.c:73868: error: dereferencing pointer to incomplete type
src/lxml/lxml.etree.c: In function ‘__pyx_f_4lxml_5etree_14_ParserContext__copy’:
src/lxml/lxml.etree.c:73962: error: dereferencing pointer to incomplete type
src/lxml/lxml.etree.c: In function ‘__pyx_f_4lxml_5etree_14_ParserContext_prepare’:
src/lxml/lxml.etree.c:74266: error: dereferencing pointer to incomplete type
src/lxml/lxml.etree.c: In function ‘__pyx_f_4lxml_5etree_14_ParserContext_cleanup’:
src/lxml/lxml.etree.c:74324: error: dereferencing pointer to incomplete type
src/lxml/lxml.etree.c: In function ‘__pyx_f_4lxml_5etree__handleParseResult’:
src/lxml/lxml.etree.c:75040: error: dereferencing pointer to incomplete type
src/lxml/lxml.etree.c:75481: error: dereferencing pointer to incomplete type
src/lxml/lxml.etree.c:75494: error: dereferencing pointer to incomplete type
src/lxml/lxml.etree.c: In function ‘__pyx_f_4lxml_5etree_9iterparse__read_more_events’:
src/lxml/lxml.etree.c:99050: error: dereferencing pointer to incomplete type
src/lxml/lxml.etree.c: In function ‘__pyx_f_4lxml_5etree_9iterparse__read_more_events’:
src/lxml/lxml.etree.c:99050: error: dereferencing pointer to incomplete type
src/lxml/lxml.etree.c: In function ‘__pyx_f_4lxml_5etree_9XMLSchema__newSaxValidator’:
src/lxml/lxml.etree.c:133262: error: dereferencing pointer to incomplete type
src/lxml/lxml.etree.c:133262: error: dereferencing pointer to incomplete type
src/lxml/lxml.etree.c:133262: error: dereferencing pointer to incomplete type
src/lxml/lxml.etree.c:133263: error: dereferencing pointer to incomplete type
src/lxml/lxml.etree.c:133298: error: dereferencing pointer to incomplete type
src/lxml/lxml.etree.c: In function ‘__pyx_pf_4lxml_5etree_30_ParserSchemaValidationContext___cinit__’:
src/lxml/lxml.etree.c:133349: error: dereferencing pointer to incomplete type
src/lxml/lxml.etree.c:133358: error: dereferencing pointer to incomplete type
src/lxml/lxml.etree.c:133367: error: dereferencing pointer to incomplete type
src/lxml/lxml.etree.c: In function ‘__pyx_pf_4lxml_5etree_30_ParserSchemaValidationContext_1__dealloc__’:
src/lxml/lxml.etree.c:133395: error: dereferencing pointer to incomplete type
src/lxml/lxml.etree.c:133404: error: dereferencing pointer to incomplete type
src/lxml/lxml.etree.c:133414: error: dereferencing pointer to incomplete type
src/lxml/lxml.etree.c: In function ‘__pyx_f_4lxml_5etree_30_ParserSchemaValidationContext_copy’:
src/lxml/lxml.etree.c:133448: error: dereferencing pointer to incomplete type
src/lxml/lxml.etree.c:133471: error: dereferencing pointer to incomplete type
src/lxml/lxml.etree.c:133471: error: dereferencing pointer to incomplete type
src/lxml/lxml.etree.c:133471: error: dereferencing pointer to incomplete type
src/lxml/lxml.etree.c: In function ‘__pyx_f_4lxml_5etree_30_ParserSchemaValidationContext_inject_default_attributes’:
src/lxml/lxml.etree.c:133508: error: dereferencing pointer to incomplete type
src/lxml/lxml.etree.c:133531: error: dereferencing pointer to incomplete type
src/lxml/lxml.etree.c: In function ‘__pyx_f_4lxml_5etree_30_ParserSchemaValidationContext_connect’:
src/lxml/lxml.etree.c:133578: error: dereferencing pointer to incomplete type
src/lxml/lxml.etree.c:133588: error: dereferencing pointer to incomplete type
src/lxml/lxml.etree.c:133588: error: dereferencing pointer to incomplete type
src/lxml/lxml.etree.c:133597: error: dereferencing pointer to incomplete type
src/lxml/lxml.etree.c:133624: error: dereferencing pointer to incomplete type
src/lxml/lxml.etree.c:133633: error: dereferencing pointer to incomplete type
src/lxml/lxml.etree.c:133648: error: dereferencing pointer to incomplete type
src/lxml/lxml.etree.c:133648: error: dereferencing pointer to incomplete type
src/lxml/lxml.etree.c: In function ‘__pyx_f_4lxml_5etree_30_ParserSchemaValidationContext_disconnect’:
src/lxml/lxml.etree.c:133681: error: dereferencing pointer to incomplete type
src/lxml/lxml.etree.c:133691: error: dereferencing pointer to incomplete type
src/lxml/lxml.etree.c:133700: error: dereferencing pointer to incomplete type
src/lxml/lxml.etree.c: In function ‘__pyx_f_4lxml_5etree_30_ParserSchemaValidationContext_isvalid’:
src/lxml/lxml.etree.c:133729: error: dereferencing pointer to incomplete type
src/lxml/lxml.etree.c:133749: error: dereferencing pointer to incomplete type
src/lxml/lxml.etree.c: In function ‘__pyx_f_4lxml_5etree_9XMLSchema__newSaxValidator’:
src/lxml/lxml.etree.c:133262: error: dereferencing pointer to incomplete type
src/lxml/lxml.etree.c:133262: error: dereferencing pointer to incomplete type
src/lxml/lxml.etree.c:133262: error: dereferencing pointer to incomplete type
src/lxml/lxml.etree.c:133263: error: dereferencing pointer to incomplete type
src/lxml/lxml.etree.c:133298: error: dereferencing pointer to incomplete type
src/lxml/lxml.etree.c: In function ‘__pyx_pf_4lxml_5etree_30_ParserSchemaValidationContext___cinit__’:
src/lxml/lxml.etree.c:133349: error: dereferencing pointer to incomplete type
src/lxml/lxml.etree.c:133358: error: dereferencing pointer to incomplete type
src/lxml/lxml.etree.c:133367: error: dereferencing pointer to incomplete type
src/lxml/lxml.etree.c: In function ‘__pyx_pf_4lxml_5etree_30_ParserSchemaValidationContext_1__dealloc__’:
src/lxml/lxml.etree.c:133395: error: dereferencing pointer to incomplete type
src/lxml/lxml.etree.c:133404: error: dereferencing pointer to incomplete type
src/lxml/lxml.etree.c:133414: error: dereferencing pointer to incomplete type
src/lxml/lxml.etree.c: In function ‘__pyx_f_4lxml_5etree_30_ParserSchemaValidationContext_copy’:
src/lxml/lxml.etree.c:133448: error: dereferencing pointer to incomplete type
src/lxml/lxml.etree.c:133471: error: dereferencing pointer to incomplete type
src/lxml/lxml.etree.c:133471: error: dereferencing pointer to incomplete type
src/lxml/lxml.etree.c:133471: error: dereferencing pointer to incomplete type
src/lxml/lxml.etree.c: In function ‘__pyx_f_4lxml_5etree_30_ParserSchemaValidationContext_inject_default_attributes’:
src/lxml/lxml.etree.c:133508: error: dereferencing pointer to incomplete type
src/lxml/lxml.etree.c:133531: error: dereferencing pointer to incomplete type
src/lxml/lxml.etree.c: In function ‘__pyx_f_4lxml_5etree_30_ParserSchemaValidationContext_connect’:
src/lxml/lxml.etree.c:133578: error: dereferencing pointer to incomplete type
src/lxml/lxml.etree.c:133588: error: dereferencing pointer to incomplete type
src/lxml/lxml.etree.c:133588: error: dereferencing pointer to incomplete type
src/lxml/lxml.etree.c:133597: error: dereferencing pointer to incomplete type
src/lxml/lxml.etree.c:133624: error: dereferencing pointer to incomplete type
src/lxml/lxml.etree.c:133633: error: dereferencing pointer to incomplete type
src/lxml/lxml.etree.c:133648: error: dereferencing pointer to incomplete type
src/lxml/lxml.etree.c:133648: error: dereferencing pointer to incomplete type
src/lxml/lxml.etree.c: In function ‘__pyx_f_4lxml_5etree_30_ParserSchemaValidationContext_disconnect’:
src/lxml/lxml.etree.c:133681: error: dereferencing pointer to incomplete type
src/lxml/lxml.etree.c:133691: error: dereferencing pointer to incomplete type
src/lxml/lxml.etree.c:133700: error: dereferencing pointer to incomplete type
src/lxml/lxml.etree.c: In function ‘__pyx_f_4lxml_5etree_30_ParserSchemaValidationContext_isvalid’:
src/lxml/lxml.etree.c:133729: error: dereferencing pointer to incomplete type
src/lxml/lxml.etree.c:133749: error: dereferencing pointer to incomplete type
src/lxml/lxml.etree.c: In function ‘__pyx_tp_new_4lxml_5etree__ParserSchemaValidationContext’:
src/lxml/lxml.etree.c:149004: error: dereferencing pointer to incomplete type
src/lxml/lxml.etree.c:149005: error: dereferencing pointer to incomplete type
src/lxml/lxml.etree.c: In function ‘__pyx_tp_dealloc_4lxml_5etree__ParserSchemaValidationContext’:
src/lxml/lxml.etree.c:149023: error: dereferencing pointer to incomplete type
src/lxml/lxml.etree.c:149023: error: dereferencing pointer to incomplete type
src/lxml/lxml.etree.c:149023: error: dereferencing pointer to incomplete type
src/lxml/lxml.etree.c:149023: error: dereferencing pointer to incomplete type
src/lxml/lxml.etree.c: In function ‘__pyx_tp_traverse_4lxml_5etree__ParserSchemaValidationContext’:
src/lxml/lxml.etree.c:149030: error: dereferencing pointer to incomplete type
src/lxml/lxml.etree.c:149031: error: dereferencing pointer to incomplete type
src/lxml/lxml.etree.c: In function ‘__pyx_tp_clear_4lxml_5etree__ParserSchemaValidationContext’:
src/lxml/lxml.etree.c:149039: error: dereferencing pointer to incomplete type
src/lxml/lxml.etree.c:149040: error: dereferencing pointer to incomplete type
src/lxml/lxml.etree.c: At top level:
src/lxml/lxml.etree.c:149150: error: invalid application of ‘sizeof’ to incomplete type ‘struct __pyx_obj_4lxml_5etree__ParserSchemaValidationContext’ 
src/lxml/lxml.etree.c: In function ‘__pyx_tp_new_4lxml_5etree__ParserSchemaValidationContext’:
src/lxml/lxml.etree.c:149004: error: dereferencing pointer to incomplete type
src/lxml/lxml.etree.c:149005: error: dereferencing pointer to incomplete type
src/lxml/lxml.etree.c: In function ‘__pyx_tp_dealloc_4lxml_5etree__ParserSchemaValidationContext’:
src/lxml/lxml.etree.c:149023: error: dereferencing pointer to incomplete type
src/lxml/lxml.etree.c:149023: error: dereferencing pointer to incomplete type
src/lxml/lxml.etree.c:149023: error: dereferencing pointer to incomplete type
src/lxml/lxml.etree.c:149023: error: dereferencing pointer to incomplete type
src/lxml/lxml.etree.c: In function ‘__pyx_tp_traverse_4lxml_5etree__ParserSchemaValidationContext’:
src/lxml/lxml.etree.c:149030: error: dereferencing pointer to incomplete type
src/lxml/lxml.etree.c:149031: error: dereferencing pointer to incomplete type
src/lxml/lxml.etree.c: In function ‘__pyx_tp_clear_4lxml_5etree__ParserSchemaValidationContext’:
src/lxml/lxml.etree.c:149039: error: dereferencing pointer to incomplete type
src/lxml/lxml.etree.c:149040: error: dereferencing pointer to incomplete type
src/lxml/lxml.etree.c: At top level:
src/lxml/lxml.etree.c:149150: error: invalid application of ‘sizeof’ to incomplete type ‘struct __pyx_obj_4lxml_5etree__ParserSchemaValidationContext’ 
lipo: can't open input file: /var/folders/NA/NA4jZIQeGBihRLry0Fm6v++++TI/-Tmp-//ccpgwsWT.out (No such file or directory)
error: Setup script exited with error: command 'gcc' failed with exit status 1

我无法通过查看错误来告诉您根本原因,但有两件简单的事情您可以先尝试:

  • 如果尚未安装,请以超级用户身份运行安装(
    sudo easy\u install lxml
  • 尝试使用pip进行安装。我很幸运地使用pip在OSX 10.6和10.7上安装了lxml,这是值得的。如果您还没有pip,只需执行
    sudo easy\u安装pip
    。然后执行
    sudopip安装lxml
如果不起作用,请告诉我们


编辑:我相信easy_install和pip都使用相同的包repos,但值得一试。

只是一个猜测,但从错误来看,它似乎找不到libxslt。您可以将其安装在非标准位置(它正在
/usr/lib
中查找),在这种情况下,可能会有一个命令行选项来告诉安装程序在哪里查找。否则,您可能必须在
/usr/lib
中安装libxslt,也许这一行特别指出了问题的根源?gcc-fno严格别名-Wno long double-no cpp precomp-mno fused madd-fno common-dynamic-DNDEBUG-g-Os-Wall-Wstrict原型-DMACOSX-I/usr/include/ffi-DENABLE_DTRACE-arch i386-arch ppc-pipe-I/usr/include/libxml2-I/System/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5-c src/lxml/lxml.etree.c-o build/temp.macosx-10.5-i386-2.5/src/lxml/lxml.etree.o-w-flat_命名空间src/lxml/lxml.etree.c:276:31:错误:libxml/schematron.h:没有这样的文件或目录hmm,您可能有旧的/不匹配的libxml2版本。如果您想避免手动修复带来的麻烦,可以尝试针对lxml的macports包<代码>端口搜索lxml以查看可用版本。