2013-08-26 98 views
4

我有持续存在的问题试图安装框架和使用蟒蛇包膜内PIP需要GDAL或LXML包。我使用Anaconda安装的Python 2.7.5运行OSX 10.8。我已经安装了Xcode 4.6.3和命令行工具。PIP Anaconda的ENV安装LXML和@中失败

在需要LXML或GDAL(几乎所有的GIS包),我得到铛错误包。这些通常是错误1或错误254.我安装了GDAL框架,并且(显然)与QGIS一起工作(虽然这指的是系统python而不是Anaconda发行版)。我有Anaconda-提供的lxml,它似乎在env中用于脚本目的。我已经尝试更新lxml,没有任何效果。这个问题最后包含两个样本日志。抱歉,这个问题有点长......

常用多次劝告似乎得到Xcode和CLT。正如我所说,我已经做到了。

我已经看到了网络上的其他的想法有用于构建OSX的蟒蛇Python发布的C编译器做。我对C编译器一无所知,但我确实知道pip将软件包安装到系统python中没有问题。当我开始系统的Python,我得到:

Python 2.7.2 (default, Oct 11 2012, 20:14:37) 
[GCC 4.2.1 Compatible Apple Clang 4.0 (tags/Apple/clang-418.0.60)] on darwin 
Type "help", "copyright", "credits" or "license" for more information. 

的蟒蛇Python中,我得到:

Python 2.7.5 |Anaconda 1.6.1 (x86_64)| (default, Jun 28 2013, 22:20:13) 
[GCC 4.0.1 (Apple Inc. build 5493)] on darwin 
Type "help", "copyright", "credits" or "license" for more information. 

记在GCC版本的差异。这很重要吗?

最近pip尝试安装kartograph.py失败。从我的ENV中运行pip install -r https://raw.github.com/kartograph/kartograph.py/master/requirements.txt后,我陷入麻烦很快与

Running setup.py egg_info for package lxml 
    /Users/mmoncrief/anaconda/envs/py27/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'bugtrack_url' 
     warnings.warn(msg) 
    Building lxml version 3.2.3. 
    Building without Cython. 
    Using build configuration of libxslt 1.1.28 
    Building against libxml2/libxslt in the following directory: /Users/mmoncrief/anaconda/envs/py27/lib 

    warning: no previously-included files found matching '*.py' 
    warning: no files found matching '*.txt' under directory 'src/lxml/tests' 
Downloading/unpacking ordereddict (from -r https://raw.github.com/kartograph/kartograph.py/master/requirements.txt (line 8)) 
    Downloading ordereddict-1.1.tar.gz 
    Running setup.py egg_info for package ordereddict 

Downloading/unpacking tinycss (from -r https://raw.github.com/kartograph/kartograph.py/master/requirements.txt (line 9)) 
    Downloading tinycss-0.3.tar.gz (72kB): 72kB downloaded 
    Running setup.py egg_info for package tinycss 
    Building with Cython 0.19.1. 

    no previously-included directories found matching 'docs/_build' 
Downloading/unpacking argparse (from -r https://raw.github.com/kartograph/kartograph.py/master/requirements.txt (line 10)) 
    Downloading argparse-1.2.1.tar.gz (69kB): 69kB downloaded 
    Running setup.py egg_info for package argparse 

    warning: no previously-included files matching '*.pyc' found anywhere in distribution 
    warning: no previously-included files matching '*.pyo' found anywhere in distribution 
    warning: no previously-included files matching '*.orig' found anywhere in distribution 
    warning: no previously-included files matching '*.rej' found anywhere in distribution 
    no previously-included directories found matching 'doc/_build' 
    no previously-included directories found matching 'env24' 
    no previously-included directories found matching 'env25' 
    no previously-included directories found matching 'env26' 
    no previously-included directories found matching 'env27' 
Requirement already satisfied (use --upgrade to upgrade): distribute in ./anaconda/envs/py27/lib/python2.7/site-packages (from pykml->-r https://raw.github.com/kartograph/kartograph.py/master/requirements.txt (line 5)) 
Installing collected packages: GDAL, lxml, ordereddict, tinycss, argparse 
    Running setup.py install for GDAL 
    building 'osgeo._gdal' extension 
    /usr/bin/clang -fno-strict-aliasing -I/Users/mmoncrief/anaconda/envs/py27/include -arch x86_64 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I../../port -I../../gcore -I../../alg -I../../ogr/ -I/Users/mmoncrief/anaconda/envs/py27/include/python2.7 -I/Users/mmoncrief/anaconda/envs/py27/lib/python2.7/site-packages/numpy/core/include -I/Library/Frameworks/GDAL.framework/Versions/1.10/include -c extensions/gdal_wrap.cpp -o build/temp.macosx-10.5-x86_64-2.7/extensions/gdal_wrap.o 
    extensions/gdal_wrap.cpp:2230:11: warning: explicitly assigning a variable of type 'int' to itself [-Wself-assign] 
         res = SWIG_AddCast(res); 
         ~~~^   ~~~ 
    extensions/gdal_wrap.cpp:2233:11: warning: explicitly assigning a variable of type 'int' to itself [-Wself-assign] 
         res = SWIG_AddCast(res); 
         ~~~^   ~~~ 
    extensions/gdal_wrap.cpp:2853:10: fatal error: 'cpl_port.h' file not found 
    #include "cpl_port.h" 
      ^
    2 warnings and 1 error generated. 
    error: command '/usr/bin/clang' failed with exit status 1 
    Complete output from command /Users/mmoncrief/anaconda/envs/py27/bin/python -c "import setuptools;__file__='/private/var/folders/l2/zvz4t5rs7pb3n1bc4_bdz6n4cbzgwl/T/pip-build-mmoncrief/GDAL/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /var/folders/l2/zvz4t5rs7pb3n1bc4_bdz6n4cbzgwl/T/pip-JGdZ16-record/install-record.txt --single-version-externally-managed: 
    running install 

running build 

running build_py 

creating build 

creating build/lib.macosx-10.5-x86_64-2.7 

copying gdal.py -> build/lib.macosx-10.5-x86_64-2.7 

copying ogr.py -> build/lib.macosx-10.5-x86_64-2.7 

copying osr.py -> build/lib.macosx-10.5-x86_64-2.7 

copying gdalconst.py -> build/lib.macosx-10.5-x86_64-2.7 

copying gdalnumeric.py -> build/lib.macosx-10.5-x86_64-2.7 

creating build/lib.macosx-10.5-x86_64-2.7/osgeo 

copying osgeo/__init__.py -> build/lib.macosx-10.5-x86_64-2.7/osgeo 

copying osgeo/gdal.py -> build/lib.macosx-10.5-x86_64-2.7/osgeo 

copying osgeo/gdal_array.py -> build/lib.macosx-10.5-x86_64-2.7/osgeo 

copying osgeo/gdalconst.py -> build/lib.macosx-10.5-x86_64-2.7/osgeo 

copying osgeo/gdalnumeric.py -> build/lib.macosx-10.5-x86_64-2.7/osgeo 

copying osgeo/ogr.py -> build/lib.macosx-10.5-x86_64-2.7/osgeo 

copying osgeo/osr.py -> build/lib.macosx-10.5-x86_64-2.7/osgeo 

running build_ext 

building 'osgeo._gdal' extension 

creating build/temp.macosx-10.5-x86_64-2.7 

creating build/temp.macosx-10.5-x86_64-2.7/extensions 

/usr/bin/clang -fno-strict-aliasing -I/Users/mmoncrief/anaconda/envs/py27/include -arch x86_64 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I../../port -I../../gcore -I../../alg -I../../ogr/ -I/Users/mmoncrief/anaconda/envs/py27/include/python2.7 -I/Users/mmoncrief/anaconda/envs/py27/lib/python2.7/site-packages/numpy/core/include -I/Library/Frameworks/GDAL.framework/Versions/1.10/include -c extensions/gdal_wrap.cpp -o build/temp.macosx-10.5-x86_64-2.7/extensions/gdal_wrap.o 

extensions/gdal_wrap.cpp:2230:11: warning: explicitly assigning a variable of type 'int' to itself [-Wself-assign] 

        res = SWIG_AddCast(res); 

        ~~~^   ~~~ 

extensions/gdal_wrap.cpp:2233:11: warning: explicitly assigning a variable of type 'int' to itself [-Wself-assign] 

        res = SWIG_AddCast(res); 

        ~~~^   ~~~ 

extensions/gdal_wrap.cpp:2853:10: fatal error: 'cpl_port.h' file not found 

#include "cpl_port.h" 

     ^

2 warnings and 1 error generated. 

error: command '/usr/bin/clang' failed with exit status 1 

---------------------------------------- 
Command /Users/mmoncrief/anaconda/envs/py27/bin/python -c "import setuptools;__file__='/private/var/folders/l2/zvz4t5rs7pb3n1bc4_bdz6n4cbzgwl/T/pip-build-mmoncrief/GDAL/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /var/folders/l2/zvz4t5rs7pb3n1bc4_bdz6n4cbzgwl/T/pip-JGdZ16-record/install-record.txt --single-version-externally-managed failed with error code 1 in /private/var/folders/l2/zvz4t5rs7pb3n1bc4_bdz6n4cbzgwl/T/pip-build-mmoncrief/GDAL 
Storing complete log in /Users/mmoncrief/.pip/pip.log 

我也有铿锵至lxml.etree相关的错误。你会在上面的代码中看到一些胡言乱语。此外,如果我尝试只是pip install lxml

Downloading/unpacking lxml 
    Running setup.py egg_info for package lxml 
    /Users/mmoncrief/anaconda/envs/py27/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'bugtrack_url' 
     warnings.warn(msg) 
    Building lxml version 3.2.3. 
    Building without Cython. 
    Using build configuration of libxslt 1.1.28 
    Building against libxml2/libxslt in the following directory: /Users/mmoncrief/anaconda/envs/py27/lib 

    warning: no files found matching '*.txt' under directory 'src/lxml/tests' 
Installing collected packages: lxml 
    Running setup.py install for lxml 
    /Users/mmoncrief/anaconda/envs/py27/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'bugtrack_url' 
     warnings.warn(msg) 
    Building lxml version 3.2.3. 
    Building without Cython. 
    Using build configuration of libxslt 1.1.28 
    Building against libxml2/libxslt in the following directory: /Users/mmoncrief/anaconda/envs/py27/lib 
    building 'lxml.etree' extension 
    /usr/bin/clang -fno-strict-aliasing -I/Users/mmoncrief/anaconda/envs/py27/include -arch x86_64 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Users/mmoncrief/anaconda/envs/py27/include -I/Users/mmoncrief/anaconda/envs/py27/include/libxml2 -I/private/var/folders/l2/zvz4t5rs7pb3n1bc4_bdz6n4cbzgwl/T/pip-build-mmoncrief/lxml/src/lxml/includes -I/Users/mmoncrief/anaconda/envs/py27/include/python2.7 -c src/lxml/lxml.etree.c -o build/temp.macosx-10.5-x86_64-2.7/src/lxml/lxml.etree.o -flat_namespace 
    clang: warning: argument unused during compilation: '-flat_namespace' 
    src/lxml/lxml.etree.c:136455:17: warning: enumeration value '__pyx_e_4lxml_5etree_PARSER_DATA_INVALID' not handled in switch [-Wswitch] 
      switch (__pyx_v_doc_ref->_type) { 
        ^
    src/lxml/lxml.etree.c:140541:72: warning: incompatible pointer types passing 'struct __pyx_obj_4lxml_5etree__BaseContext *' to parameter of type 'struct __pyx_obj_4lxml_5etree__XSLTContext *' [-Wincompatible-pointer-types] 
     __pyx_t_1 = ((PyObject *)__pyx_f_4lxml_5etree_12_XSLTContext__copy(((struct __pyx_obj_4lxml_5etree__BaseContext *)__pyx_v_self->_context))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 543; __pyx_clineno = __LINE__; goto __pyx_L9;} 
                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
    src/lxml/lxml.etree.c:138476:138: note: passing argument to parameter '__pyx_v_self' here 
    static struct __pyx_obj_4lxml_5etree__BaseContext *__pyx_f_4lxml_5etree_12_XSLTContext__copy(struct __pyx_obj_4lxml_5etree__XSLTContext *__pyx_v_self) { 
                                      ^
    src/lxml/lxml.etree.c:141947:70: warning: incompatible pointer types passing 'struct __pyx_obj_4lxml_5etree__BaseContext *' to parameter of type 'struct __pyx_obj_4lxml_5etree__XSLTContext *' [-Wincompatible-pointer-types] 
     __pyx_t_1 = ((PyObject *)__pyx_f_4lxml_5etree_12_XSLTContext__copy(((struct __pyx_obj_4lxml_5etree__BaseContext *)__pyx_v_stylesheet->_context))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 680; __pyx_clineno = __LINE__; goto __pyx_L1_error;} 
                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
    src/lxml/lxml.etree.c:138476:138: note: passing argument to parameter '__pyx_v_self' here 
    static struct __pyx_obj_4lxml_5etree__BaseContext *__pyx_f_4lxml_5etree_12_XSLTContext__copy(struct __pyx_obj_4lxml_5etree__XSLTContext *__pyx_v_self) { 
                                      ^
    src/lxml/lxml.etree.c:160878:19: warning: expression result unused [-Wunused-value] 
     PyObject_INIT(o, t); 
        ^
    /Users/mmoncrief/anaconda/envs/py27/include/python2.7/objimpl.h:164:69: note: expanded from macro 'PyObject_INIT' 
     (Py_TYPE(op) = (typeobj), _Py_NewReference((PyObject *)(op)), (op)) 
                     ^
    src/lxml/lxml.etree.c:162691:19: warning: expression result unused [-Wunused-value] 
     PyObject_INIT(o, t); 
        ^
    /Users/mmoncrief/anaconda/envs/py27/include/python2.7/objimpl.h:164:69: note: expanded from macro 'PyObject_INIT' 
     (Py_TYPE(op) = (typeobj), _Py_NewReference((PyObject *)(op)), (op)) 
                     ^
    src/lxml/lxml.etree.c:168247:19: warning: expression result unused [-Wunused-value] 
     PyObject_INIT(o, t); 
        ^
    /Users/mmoncrief/anaconda/envs/py27/include/python2.7/objimpl.h:164:69: note: expanded from macro 'PyObject_INIT' 
     (Py_TYPE(op) = (typeobj), _Py_NewReference((PyObject *)(op)), (op)) 
                     ^
    src/lxml/lxml.etree.c:170913:19: warning: expression result unused [-Wunused-value] 
     PyObject_INIT(o, t); 
        ^
    /Users/mmoncrief/anaconda/envs/py27/include/python2.7/objimpl.h:164:69: note: expanded from macro 'PyObject_INIT' 
     (Py_TYPE(op) = (typeobj), _Py_NewReference((PyObject *)(op)), (op)) 
                     ^
    src/lxml/lxml.etree.c:12774:13: warning: function '__pyx_f_4lxml_5etree_displayNode' is not needed and will not be emitted [-Wunneeded-internal-declaration] 
    static void __pyx_f_4lxml_5etree_displayNode(xmlNode *__pyx_v_c_node, PyObject *__pyx_v_indent) { 
       ^
    8 warnings generated. 
    /usr/bin/clang -bundle -undefined dynamic_lookup -L/Users/mmoncrief/anaconda/envs/py27/lib -arch x86_64 -arch x86_64 build/temp.macosx-10.5-x86_64-2.7/src/lxml/lxml.etree.o -L/Users/mmoncrief/anaconda/envs/py27/lib -lxslt -lexslt -lxml2 -lz -lm -o build/lib.macosx-10.5-x86_64-2.7/lxml/etree.so 
    clang: error: unable to execute command: Segmentation fault: 11 
    clang: error: linker command failed due to signal (use -v to see invocation) 
    error: command '/usr/bin/clang' failed with exit status 254 
    Complete output from command /Users/mmoncrief/anaconda/envs/py27/bin/python -c "import setuptools;__file__='/private/var/folders/l2/zvz4t5rs7pb3n1bc4_bdz6n4cbzgwl/T/pip-build-mmoncrief/lxml/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /var/folders/l2/zvz4t5rs7pb3n1bc4_bdz6n4cbzgwl/T/pip-gtlqX_-record/install-record.txt --single-version-externally-managed: 
    /Users/mmoncrief/anaconda/envs/py27/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'bugtrack_url' 

    warnings.warn(msg) 

Building lxml version 3.2.3. 

Building without Cython. 

Using build configuration of libxslt 1.1.28 

Building against libxml2/libxslt in the following directory: /Users/mmoncrief/anaconda/envs/py27/lib 

running install 

running build 

running build_py 

creating build 

creating build/lib.macosx-10.5-x86_64-2.7 

creating build/lib.macosx-10.5-x86_64-2.7/lxml 

copying src/lxml/__init__.py -> build/lib.macosx-10.5-x86_64-2.7/lxml 

copying src/lxml/_elementpath.py -> build/lib.macosx-10.5-x86_64-2.7/lxml 

copying src/lxml/builder.py -> build/lib.macosx-10.5-x86_64-2.7/lxml 

copying src/lxml/cssselect.py -> build/lib.macosx-10.5-x86_64-2.7/lxml 

copying src/lxml/doctestcompare.py -> build/lib.macosx-10.5-x86_64-2.7/lxml 

copying src/lxml/ElementInclude.py -> build/lib.macosx-10.5-x86_64-2.7/lxml 

copying src/lxml/pyclasslookup.py -> build/lib.macosx-10.5-x86_64-2.7/lxml 

copying src/lxml/sax.py -> build/lib.macosx-10.5-x86_64-2.7/lxml 

copying src/lxml/usedoctest.py -> build/lib.macosx-10.5-x86_64-2.7/lxml 

creating build/lib.macosx-10.5-x86_64-2.7/lxml/includes 

copying src/lxml/includes/__init__.py -> build/lib.macosx-10.5-x86_64-2.7/lxml/includes 

creating build/lib.macosx-10.5-x86_64-2.7/lxml/html 

copying src/lxml/html/__init__.py -> build/lib.macosx-10.5-x86_64-2.7/lxml/html 

copying src/lxml/html/_diffcommand.py -> build/lib.macosx-10.5-x86_64-2.7/lxml/html 

copying src/lxml/html/_html5builder.py -> build/lib.macosx-10.5-x86_64-2.7/lxml/html 

copying src/lxml/html/_setmixin.py -> build/lib.macosx-10.5-x86_64-2.7/lxml/html 

copying src/lxml/html/builder.py -> build/lib.macosx-10.5-x86_64-2.7/lxml/html 

copying src/lxml/html/clean.py -> build/lib.macosx-10.5-x86_64-2.7/lxml/html 

copying src/lxml/html/defs.py -> build/lib.macosx-10.5-x86_64-2.7/lxml/html 

copying src/lxml/html/diff.py -> build/lib.macosx-10.5-x86_64-2.7/lxml/html 

copying src/lxml/html/ElementSoup.py -> build/lib.macosx-10.5-x86_64-2.7/lxml/html 

copying src/lxml/html/formfill.py -> build/lib.macosx-10.5-x86_64-2.7/lxml/html 

copying src/lxml/html/html5parser.py -> build/lib.macosx-10.5-x86_64-2.7/lxml/html 

copying src/lxml/html/soupparser.py -> build/lib.macosx-10.5-x86_64-2.7/lxml/html 

copying src/lxml/html/usedoctest.py -> build/lib.macosx-10.5-x86_64-2.7/lxml/html 

creating build/lib.macosx-10.5-x86_64-2.7/lxml/isoschematron 

copying src/lxml/isoschematron/__init__.py -> build/lib.macosx-10.5-x86_64-2.7/lxml/isoschematron 

copying src/lxml/lxml.etree.h -> build/lib.macosx-10.5-x86_64-2.7/lxml 

copying src/lxml/lxml.etree_api.h -> build/lib.macosx-10.5-x86_64-2.7/lxml 

copying src/lxml/includes/c14n.pxd -> build/lib.macosx-10.5-x86_64-2.7/lxml/includes 

copying src/lxml/includes/config.pxd -> build/lib.macosx-10.5-x86_64-2.7/lxml/includes 

copying src/lxml/includes/dtdvalid.pxd -> build/lib.macosx-10.5-x86_64-2.7/lxml/includes 

copying src/lxml/includes/etreepublic.pxd -> build/lib.macosx-10.5-x86_64-2.7/lxml/includes 

copying src/lxml/includes/htmlparser.pxd -> build/lib.macosx-10.5-x86_64-2.7/lxml/includes 

copying src/lxml/includes/relaxng.pxd -> build/lib.macosx-10.5-x86_64-2.7/lxml/includes 

copying src/lxml/includes/schematron.pxd -> build/lib.macosx-10.5-x86_64-2.7/lxml/includes 

copying src/lxml/includes/tree.pxd -> build/lib.macosx-10.5-x86_64-2.7/lxml/includes 

copying src/lxml/includes/uri.pxd -> build/lib.macosx-10.5-x86_64-2.7/lxml/includes 

copying src/lxml/includes/xinclude.pxd -> build/lib.macosx-10.5-x86_64-2.7/lxml/includes 

copying src/lxml/includes/xmlerror.pxd -> build/lib.macosx-10.5-x86_64-2.7/lxml/includes 

copying src/lxml/includes/xmlparser.pxd -> build/lib.macosx-10.5-x86_64-2.7/lxml/includes 

copying src/lxml/includes/xmlschema.pxd -> build/lib.macosx-10.5-x86_64-2.7/lxml/includes 

copying src/lxml/includes/xpath.pxd -> build/lib.macosx-10.5-x86_64-2.7/lxml/includes 

copying src/lxml/includes/xslt.pxd -> build/lib.macosx-10.5-x86_64-2.7/lxml/includes 

copying src/lxml/includes/etree_defs.h -> build/lib.macosx-10.5-x86_64-2.7/lxml/includes 

copying src/lxml/includes/lxml-version.h -> build/lib.macosx-10.5-x86_64-2.7/lxml/includes 

creating build/lib.macosx-10.5-x86_64-2.7/lxml/isoschematron/resources 

creating build/lib.macosx-10.5-x86_64-2.7/lxml/isoschematron/resources/rng 

copying src/lxml/isoschematron/resources/rng/iso-schematron.rng -> build/lib.macosx-10.5-x86_64-2.7/lxml/isoschematron/resources/rng 

creating build/lib.macosx-10.5-x86_64-2.7/lxml/isoschematron/resources/xsl 

copying src/lxml/isoschematron/resources/xsl/RNG2Schtrn.xsl -> build/lib.macosx-10.5-x86_64-2.7/lxml/isoschematron/resources/xsl 

copying src/lxml/isoschematron/resources/xsl/XSD2Schtrn.xsl -> build/lib.macosx-10.5-x86_64-2.7/lxml/isoschematron/resources/xsl 

creating build/lib.macosx-10.5-x86_64-2.7/lxml/isoschematron/resources/xsl/iso-schematron-xslt1 

copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_abstract_expand.xsl -> build/lib.macosx-10.5-x86_64-2.7/lxml/isoschematron/resources/xsl/iso-schematron-xslt1 

copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_dsdl_include.xsl -> build/lib.macosx-10.5-x86_64-2.7/lxml/isoschematron/resources/xsl/iso-schematron-xslt1 

copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_schematron_message.xsl -> build/lib.macosx-10.5-x86_64-2.7/lxml/isoschematron/resources/xsl/iso-schematron-xslt1 

copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_schematron_skeleton_for_xslt1.xsl -> build/lib.macosx-10.5-x86_64-2.7/lxml/isoschematron/resources/xsl/iso-schematron-xslt1 

copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_svrl_for_xslt1.xsl -> build/lib.macosx-10.5-x86_64-2.7/lxml/isoschematron/resources/xsl/iso-schematron-xslt1 

copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/readme.txt -> build/lib.macosx-10.5-x86_64-2.7/lxml/isoschematron/resources/xsl/iso-schematron-xslt1 

running build_ext 

building 'lxml.etree' extension 

creating build/temp.macosx-10.5-x86_64-2.7 

creating build/temp.macosx-10.5-x86_64-2.7/src 

creating build/temp.macosx-10.5-x86_64-2.7/src/lxml 

/usr/bin/clang -fno-strict-aliasing -I/Users/mmoncrief/anaconda/envs/py27/include -arch x86_64 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Users/mmoncrief/anaconda/envs/py27/include -I/Users/mmoncrief/anaconda/envs/py27/include/libxml2 -I/private/var/folders/l2/zvz4t5rs7pb3n1bc4_bdz6n4cbzgwl/T/pip-build-mmoncrief/lxml/src/lxml/includes -I/Users/mmoncrief/anaconda/envs/py27/include/python2.7 -c src/lxml/lxml.etree.c -o build/temp.macosx-10.5-x86_64-2.7/src/lxml/lxml.etree.o -flat_namespace 

clang: warning: argument unused during compilation: '-flat_namespace' 

src/lxml/lxml.etree.c:136455:17: warning: enumeration value '__pyx_e_4lxml_5etree_PARSER_DATA_INVALID' not handled in switch [-Wswitch] 

     switch (__pyx_v_doc_ref->_type) { 

       ^

src/lxml/lxml.etree.c:140541:72: warning: incompatible pointer types passing 'struct __pyx_obj_4lxml_5etree__BaseContext *' to parameter of type 'struct __pyx_obj_4lxml_5etree__XSLTContext *' [-Wincompatible-pointer-types] 

    __pyx_t_1 = ((PyObject *)__pyx_f_4lxml_5etree_12_XSLTContext__copy(((struct __pyx_obj_4lxml_5etree__BaseContext *)__pyx_v_self->_context))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 543; __pyx_clineno = __LINE__; goto __pyx_L9;} 

                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 

src/lxml/lxml.etree.c:138476:138: note: passing argument to parameter '__pyx_v_self' here 

static struct __pyx_obj_4lxml_5etree__BaseContext *__pyx_f_4lxml_5etree_12_XSLTContext__copy(struct __pyx_obj_4lxml_5etree__XSLTContext *__pyx_v_self) { 

                                     ^

src/lxml/lxml.etree.c:141947:70: warning: incompatible pointer types passing 'struct __pyx_obj_4lxml_5etree__BaseContext *' to parameter of type 'struct __pyx_obj_4lxml_5etree__XSLTContext *' [-Wincompatible-pointer-types] 

    __pyx_t_1 = ((PyObject *)__pyx_f_4lxml_5etree_12_XSLTContext__copy(((struct __pyx_obj_4lxml_5etree__BaseContext *)__pyx_v_stylesheet->_context))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 680; __pyx_clineno = __LINE__; goto __pyx_L1_error;} 

                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 

src/lxml/lxml.etree.c:138476:138: note: passing argument to parameter '__pyx_v_self' here 

static struct __pyx_obj_4lxml_5etree__BaseContext *__pyx_f_4lxml_5etree_12_XSLTContext__copy(struct __pyx_obj_4lxml_5etree__XSLTContext *__pyx_v_self) { 

                                     ^

src/lxml/lxml.etree.c:160878:19: warning: expression result unused [-Wunused-value] 

    PyObject_INIT(o, t); 

       ^

/Users/mmoncrief/anaconda/envs/py27/include/python2.7/objimpl.h:164:69: note: expanded from macro 'PyObject_INIT' 

    (Py_TYPE(op) = (typeobj), _Py_NewReference((PyObject *)(op)), (op)) 

                    ^

src/lxml/lxml.etree.c:162691:19: warning: expression result unused [-Wunused-value] 

    PyObject_INIT(o, t); 

       ^

/Users/mmoncrief/anaconda/envs/py27/include/python2.7/objimpl.h:164:69: note: expanded from macro 'PyObject_INIT' 

    (Py_TYPE(op) = (typeobj), _Py_NewReference((PyObject *)(op)), (op)) 

                    ^

src/lxml/lxml.etree.c:168247:19: warning: expression result unused [-Wunused-value] 

    PyObject_INIT(o, t); 

       ^

/Users/mmoncrief/anaconda/envs/py27/include/python2.7/objimpl.h:164:69: note: expanded from macro 'PyObject_INIT' 

    (Py_TYPE(op) = (typeobj), _Py_NewReference((PyObject *)(op)), (op)) 

                    ^

src/lxml/lxml.etree.c:170913:19: warning: expression result unused [-Wunused-value] 

    PyObject_INIT(o, t); 

       ^

/Users/mmoncrief/anaconda/envs/py27/include/python2.7/objimpl.h:164:69: note: expanded from macro 'PyObject_INIT' 

    (Py_TYPE(op) = (typeobj), _Py_NewReference((PyObject *)(op)), (op)) 

                    ^

src/lxml/lxml.etree.c:12774:13: warning: function '__pyx_f_4lxml_5etree_displayNode' is not needed and will not be emitted [-Wunneeded-internal-declaration] 

static void __pyx_f_4lxml_5etree_displayNode(xmlNode *__pyx_v_c_node, PyObject *__pyx_v_indent) { 

      ^

8 warnings generated. 

/usr/bin/clang -bundle -undefined dynamic_lookup -L/Users/mmoncrief/anaconda/envs/py27/lib -arch x86_64 -arch x86_64 build/temp.macosx-10.5-x86_64-2.7/src/lxml/lxml.etree.o -L/Users/mmoncrief/anaconda/envs/py27/lib -lxslt -lexslt -lxml2 -lz -lm -o build/lib.macosx-10.5-x86_64-2.7/lxml/etree.so 

clang: error: unable to execute command: Segmentation fault: 11 

clang: error: linker command failed due to signal (use -v to see invocation) 

error: command '/usr/bin/clang' failed with exit status 254 

---------------------------------------- 
Command /Users/mmoncrief/anaconda/envs/py27/bin/python -c "import setuptools;__file__='/private/var/folders/l2/zvz4t5rs7pb3n1bc4_bdz6n4cbzgwl/T/pip-build-mmoncrief/lxml/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /var/folders/l2/zvz4t5rs7pb3n1bc4_bdz6n4cbzgwl/T/pip-gtlqX_-record/install-record.txt --single-version-externally-managed failed with error code 1 in /private/var/folders/l2/zvz4t5rs7pb3n1bc4_bdz6n4cbzgwl/T/pip-build-mmoncrief/lxml 
Storing complete log in /Users/mmoncrief/.pip/pip.log 

帮助将不胜感激。我一直在Anaconda为其他应用程序工作,并希望继续使用此发行版。

+0

我不是究竟是不是与蟒蛇lxml的工作明确。 – asmeurer

+0

底部的lxml日志就是一个例子。我在一些软件包上发生了这种故障,我只是试图直接下载lxml,作为我在其他软件包上看到的例子。再次,我已经导入并使用lxml进行脚本编写,但是要求lxml的软件包安装似乎在lxml.etree中定期失败,如上所述。 – user2651369

+0

底部的日志来自pip install lxml。当conda安装lxml时什么都不起作用? – asmeurer

回答

0

这里是我的$ 0.02时,在我的经验LXML上安装OS X一直引起,因为libmxl2和依赖的libxslt的问题。这里的具体问题是没有发现'cpl_port.h',表明你的系统上没有gdal头文件,这与我在lxml中遇到的问题类似。我发现这个StackExchange文章gdal package missing,它使用pip和虚拟Ubuntu机器来解决构建和安装gdal时的特定错误,但这个想法是一样的。需要明确告知pip工具在哪里可以找到gdal的头文件。

一般的问题是,OS X使头在非标准的地方* nix的系统,而且经常依赖是用于你要安装的软件包的开发版本落后几个版本。您可以使用MacPorts或类似的东西,它们将搭载OS X,为您的所有依赖关系创建类似于Linux的结构,并使用更多最新版本的库,但随着虚拟化变得如此之好以及运行OS XI的生产系统极少,解。我是一个15岁以上的Apple用户,但是当谈到Mac上的Python开发时,我的建议是使用某种虚拟化工具,我真的很喜欢VirtualBox的Vagrant。除非要在OS X或OS X Server上将Python代码投入生产,否则最好在最终的生产操作系统上进行开发,以便在开发过程中了解哪些依赖项版本可用并存在特定于环境的效果。再加上几乎任何其他操作系统都比OS X更容易安装像lxml和gdal这样的软件包,在Debian变体上使用简单的“sudo apt-get install -y -fix-missing”,您可以获得缺失的依赖关系,并随时随地移动。 Vagrant甚至会将您的源文件从主机同步到客户端,以便您可以毫不费力地使用您的富客户端IDE。

0

使用畅达安装@中的终端,这将提取并安装GDAL库