- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
尝试在 anaconda 环境中使用 pip 安装需要 GDAL 或 lxml 的框架和包时,我一直遇到问题。我正在使用 Anaconda 安装的 Python 2.7.5 运行 OSX 10.8。我已经安装了命令行工具的 Xcode 4.6.3。
在需要 lxml 或 GDAL 的包(几乎每个 GIS 包)上,我收到 clang 错误。这些通常是错误 1 或错误 254。我安装了 GDAL 框架并且(显然)与 QGIS 一起运行(尽管这是指系统 python 而不是 Anaconda 发行版)。我有 Anaconda 提供的 lxml,它似乎在环境中用于脚本目的。我试过更新 lxml,但没有效果。此问题末尾包含两个示例日志。抱歉问题有 pip 长...
经常重复的建议似乎是获取 Xcode 和 CLT。正如我所说,我已经做到了。
我在网上看到的另一个想法与用于为 OSX 构建 Anaconda 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.
对于 Anaconda 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 失败。在我的环境中运行 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 相关的 clang 错误。您会在上面的代码中看到其中的一些内容。另外,如果我简单地尝试 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.02 美元,根据我的经验,由于 libmxl2 和 libxslt 依赖项,在 OS X 上安装 lxml 总是会导致问题。这里的具体问题是找不到“cpl_port.h”,这表明您的系统上没有 gdal 的 header ,这与我在 lxml 中遇到的问题类似。我找到了这个 StackExchange 帖子 gdal package missing它解决了使用 pip 和虚拟 Ubuntu 机器构建和安装 gdal 的问题,但想法是一样的。需要明确告知 pip 工具在哪里可以找到 gdal 的 header 。
一般来说,问题是 OS X 将 header 放在 *nix 系统的非标准位置,并且依赖项通常比用于开发您尝试安装的软件包的版本落后几个版本。您可以使用 MacPorts 或类似的东西,它会搭载在 OS X 上,为您的所有依赖项创建一个类似于 linux 的结构,以及更多当前版本的库,但是随着虚拟化变得如此好,运行 OS X 的生产系统很少,我觉得有一个更简单的解决方案。我是 15 年以上的 Apple 用户,但在 Mac 上进行 Python 开发时,我的建议是使用某种虚拟化工具,我真的很喜欢 Vagrant with VirtualBox。除非你打算在 OS X 或 OS X Server 上将你的 Python 代码投入生产,否则最好在最终的生产操作系统上开发,这样你在开发过程中就知道哪些依赖版本可用以及存在特定于环境的影响。此外,几乎任何其他操作系统都比 OS X 更容易安装 lxml 和 gdal 等软件包,在 Debian 变体上使用简单的“sudo apt-get install -y --fix-missing”,您可以获得缺少的依赖项并继续前进。 Vagrant 甚至会将您的源文件从主机同步到 guest ,因此您可以毫不费力地使用富客户端 IDE。
关于python - pip install lxml 和 gdal 在 anaconda env 中失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18436346/
我有以下xml文件 10.10.0.135::3111 10.10.0.130::3111 10.10.0.129::3111 10.
我已经为 PyPy 创建了一个 virtualenv: virtualenv test -p `which pypy` source test/bin/activate 我安装了以下依赖项: sudo
我正在尝试使用 lxml 的 ElementTree etree 在我的 xml 文档中查找特定标签。标签如下所示: 12 我希望使用 etree.find('text:statedAge
在 python 3.5 项目中,我必须读取一些 xml 文件,因此我决定使用 lxml 库。由于我正在阅读文件,因此根据文档执行此操作的最有效方法是使用 lxml.etree.parse(...)
执行 pip install lxml 或 pip install pyquery 会出现此错误: gcc: error trying to exec 'cc1': execvp: No such f
我正在使用下面的代码获取一个部分的所有 html 内容以保存到数据库 el = doc.get_element_by_id('productDescription') lxml.html.tostri
我想以可区分的方式打印出 etree 的树结构(由 html 文档形成)(意味着两个 etree 应该以不同的方式打印出来)。 我所说的结构是指树的“形状”,基本上是指所有标签,但没有属性,也没有文本
谁能解释为什么第一次调用 root.cssselect() 有效,而第二次失败? from lxml.html import fromstring from lxml import etree htm
我收到此错误“ImportError: No module named lxml”,即使确实安装了 LXML。具体来说,它安装在项目的 python Virtualenv 中。最终我正在研究 Pyth
我在 Windows 32 位上使用 Anaconda v4.2 和 Python 3.5,并想使用 lxml etree。我的 Anaconda 发行版包括 lxml 3.6.4,但我的 IDE(P
我有一个脚本,可以从 URL 列表的 XML 文件中提取一些术语。所有 URL 都可以访问 XML 数据。 它在第一次正确打开、解析和提取时工作正常,但随后在过程中被某些 XML 文件中断并出现此错误
我正在使用 mechanize/cookiejar/lxml 来读取页面,它适用于某些页面但不适用于其他页面。我在其中遇到的错误是标题中的错误。我不能在这里发布页面,因为它们不是 SFW,但是有没有办
这是一个基本的问题,我实际上在文档中找不到它:-/ 如下: img = house_tree.xpath('//img[@id="mainphoto"]')[0] 如何获取 的 HTML标记? 我尝
我只想说,这个问题我已经在Pip is already installed: but I am getting no module named lxml看到了并且已经看到关于以非 root 用户身份安
我通过 pip 安装了 lxml 3.3.5。现在我在运行一些 Django 测试时遇到了问题: Traceback (most recent call last): File "manage.p
我有一个 Django 应用程序,其中包含 Tastypie 提供的 RESTFull 服务。我使用 easy_install 安装 lxml 和 defusedxml,这样我就可以使用 xml 而不
我正在使用 lxml etree 创建 xml 或 REST 调用。我有命名空间的问题,因为如果没有正确制定,我会从服务器收到语法错误。 正如您在以下 2 个示例中所看到的,我应该得到例如 ns1、n
我对导航具有 lxml.etree namespace 的 xml 文档感到有些困惑。 .我已经看到了一些关于这个主题的主题( 1 、 2 )以及 lxml docs但仍然没有想出答案。 xml =
由于各种原因,我试图从lxml.html.fromstring()切换到lxml.html.html5parser.document_fromstring()。两者之间的最大区别是,第一个返回lxml
我需要通过向现有元素添加子元素来修改现有的 xml 文件。我使用 lxml 库。 Eric Idle 999-999-999 555-555-555
我是一名优秀的程序员,十分优秀!