Cython errors building from git on Mac OS X
![](https://secure.gravatar.com/avatar/a756760b07d795f68a1dc9608243190f.jpg?s=120&d=mm&r=g)
I'm having trouble building lxml from a git clone on Mac OS X 10.6 with python.org python 2.7 or my own compiled python 2.6. Any idea what might be causing the errors below? Thanks in advance, Laurence $ python2.7 setup.py build Building lxml version 2.4.dev. Building with Cython 0.15.1. Using build configuration of libxslt 1.1.24 Building against libxml2/libxslt in the following directory: /usr/local/lib running build running build_py creating build/lib.macosx-10.6-intel-2.7 creating build/lib.macosx-10.6-intel-2.7/lxml copying src/lxml/__init__.py -> build/lib.macosx-10.6-intel-2.7/lxml copying src/lxml/_elementpath.py -> build/lib.macosx-10.6-intel-2.7/lxml copying src/lxml/builder.py -> build/lib.macosx-10.6-intel-2.7/lxml copying src/lxml/cssselect.py -> build/lib.macosx-10.6-intel-2.7/lxml copying src/lxml/doctestcompare.py -> build/lib.macosx-10.6-intel-2.7/lxml copying src/lxml/ElementInclude.py -> build/lib.macosx-10.6-intel-2.7/lxml copying src/lxml/pyclasslookup.py -> build/lib.macosx-10.6-intel-2.7/lxml copying src/lxml/sax.py -> build/lib.macosx-10.6-intel-2.7/lxml copying src/lxml/usedoctest.py -> build/lib.macosx-10.6-intel-2.7/lxml creating build/lib.macosx-10.6-intel-2.7/lxml/html copying src/lxml/html/__init__.py -> build/lib.macosx-10.6-intel-2.7/lxml/html copying src/lxml/html/_dictmixin.py -> build/lib.macosx-10.6-intel-2.7/lxml/html copying src/lxml/html/_diffcommand.py -> build/lib.macosx-10.6-intel-2.7/lxml/html copying src/lxml/html/_html5builder.py -> build/lib.macosx-10.6-intel-2.7/lxml/html copying src/lxml/html/_setmixin.py -> build/lib.macosx-10.6-intel-2.7/lxml/html copying src/lxml/html/builder.py -> build/lib.macosx-10.6-intel-2.7/lxml/html copying src/lxml/html/clean.py -> build/lib.macosx-10.6-intel-2.7/lxml/html copying src/lxml/html/defs.py -> build/lib.macosx-10.6-intel-2.7/lxml/html copying src/lxml/html/diff.py -> build/lib.macosx-10.6-intel-2.7/lxml/html copying src/lxml/html/ElementSoup.py -> build/lib.macosx-10.6-intel-2.7/lxml/html copying src/lxml/html/formfill.py -> build/lib.macosx-10.6-intel-2.7/lxml/html copying src/lxml/html/html5parser.py -> build/lib.macosx-10.6-intel-2.7/lxml/html copying src/lxml/html/soupparser.py -> build/lib.macosx-10.6-intel-2.7/lxml/html copying src/lxml/html/usedoctest.py -> build/lib.macosx-10.6-intel-2.7/lxml/html creating build/lib.macosx-10.6-intel-2.7/lxml/isoschematron copying src/lxml/isoschematron/__init__.py -> build/lib.macosx-10.6-intel-2.7/lxml/isoschematron copying src/lxml/etreepublic.pxd -> build/lib.macosx-10.6-intel-2.7/lxml copying src/lxml/tree.pxd -> build/lib.macosx-10.6-intel-2.7/lxml copying src/lxml/etree_defs.h -> build/lib.macosx-10.6-intel-2.7/lxml creating build/lib.macosx-10.6-intel-2.7/lxml/isoschematron/resources creating build/lib.macosx-10.6-intel-2.7/lxml/isoschematron/resources/rng copying src/lxml/isoschematron/resources/rng/iso-schematron.rng -> build/lib.macosx-10.6-intel-2.7/lxml/isoschematron/resources/rng creating build/lib.macosx-10.6-intel-2.7/lxml/isoschematron/resources/xsl copying src/lxml/isoschematron/resources/xsl/RNG2Schtrn.xsl -> build/lib.macosx-10.6-intel-2.7/lxml/isoschematron/resources/xsl copying src/lxml/isoschematron/resources/xsl/XSD2Schtrn.xsl -> build/lib.macosx-10.6-intel-2.7/lxml/isoschematron/resources/xsl creating build/lib.macosx-10.6-intel-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.6-intel-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.6-intel-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.6-intel-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.6-intel-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.6-intel-2.7/lxml/isoschematron/resources/xsl/iso-schematron-xslt1 copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/readme.txt -> build/lib.macosx-10.6-intel-2.7/lxml/isoschematron/resources/xsl/iso-schematron-xslt1 running build_ext cythoning src/lxml/lxml.etree.pyx to src/lxml/lxml.etree.c Error compiling Cython file: ------------------------------------------------------------ ... cdef _Element _node cdef _node_to_node_function _next_element cdef _MultiTagMatcher _matcher @cython.final cdef _initTagMatcher(self, tags): ^ ------------------------------------------------------------ src/lxml/lxml.etree.pyx:2501:9: The final compiler directive is not allowed in function scope Error compiling Cython file: ------------------------------------------------------------ ... def __iter__(self): return self @cython.final cdef int _storeNext(self, _Element node) except -1: ^ ------------------------------------------------------------ src/lxml/lxml.etree.pyx:2508:9: The final compiler directive is not allowed in function scope Error compiling Cython file: ------------------------------------------------------------ ... ] cimport cython cimport tree, python, config from tree cimport xmlDoc, xmlNode, xmlAttr, xmlNs, _isElement, _getNs ^ ------------------------------------------------------------ src/lxml/lxml.etree.pyx:43:0: 'xmlDoc.pxd' not found Error compiling Cython file: ------------------------------------------------------------ ... ] # snipped hundreds of similar errors.
![](https://secure.gravatar.com/avatar/8b97b5aad24c30e4a1357b38cc39aeaa.jpg?s=120&d=mm&r=g)
Laurence Rowe, 30.01.2012 16:59:
I'm having trouble building lxml from a git clone on Mac OS X 10.6 with python.org python 2.7 or my own compiled python 2.6. Any idea what might be causing the errors below?
$ python2.7 setup.py build Building lxml version 2.4.dev. Building with Cython 0.15.1. [...] cythoning src/lxml/lxml.etree.pyx to src/lxml/lxml.etree.c
Error compiling Cython file: ------------------------------------------------------------ ... cdef _Element _node cdef _node_to_node_function _next_element cdef _MultiTagMatcher _matcher
@cython.final cdef _initTagMatcher(self, tags): ^ ------------------------------------------------------------
src/lxml/lxml.etree.pyx:2501:9: The final compiler directive is not allowed in function scope [...]
Looks like you'll need 0.16 (i.e. the latest git version) of Cython for the latest lxml master branch. It's close to release (certainly closer than lxml 2.4) and should be stable enough for general use. Stefan
![](https://secure.gravatar.com/avatar/ede7a9c9944dd04114b34d08d25a9f3c.jpg?s=120&d=mm&r=g)
On Sun, Feb 5, 2012 at 4:01 AM, Stefan Behnel <stefan_ml@behnel.de> wrote:
Laurence Rowe, 30.01.2012 16:59:
I'm having trouble building lxml from a git clone on Mac OS X 10.6 with python.org python 2.7 or my own compiled python 2.6. Any idea what might be causing the errors below?
$ python2.7 setup.py build Building lxml version 2.4.dev. Building with Cython 0.15.1. [...] cythoning src/lxml/lxml.etree.pyx to src/lxml/lxml.etree.c
Error compiling Cython file: ------------------------------------------------------------ ... cdef _Element _node cdef _node_to_node_function _next_element cdef _MultiTagMatcher _matcher
@cython.final cdef _initTagMatcher(self, tags): ^ ------------------------------------------------------------
src/lxml/lxml.etree.pyx:2501:9: The final compiler directive is not allowed in function scope [...]
Looks like you'll need 0.16 (i.e. the latest git version) of Cython for the latest lxml master branch. It's close to release (certainly closer than lxml 2.4) and should be stable enough for general use.
Aha! You might update the minimum cython version at http://lxml.de/build.html#cython. Jeffrey
![](https://secure.gravatar.com/avatar/8b97b5aad24c30e4a1357b38cc39aeaa.jpg?s=120&d=mm&r=g)
Jeffrey Yasskin, 15.02.2012 05:51:
On Sun, Feb 5, 2012 at 4:01 AM, Stefan Behnel wrote:
Laurence Rowe, 30.01.2012 16:59:
I'm having trouble building lxml from a git clone on Mac OS X 10.6 with python.org python 2.7 or my own compiled python 2.6. Any idea what might be causing the errors below?
$ python2.7 setup.py build Building lxml version 2.4.dev. Building with Cython 0.15.1. [...] cythoning src/lxml/lxml.etree.pyx to src/lxml/lxml.etree.c
Error compiling Cython file: ------------------------------------------------------------ ... cdef _Element _node cdef _node_to_node_function _next_element cdef _MultiTagMatcher _matcher
@cython.final cdef _initTagMatcher(self, tags): ^ ------------------------------------------------------------
src/lxml/lxml.etree.pyx:2501:9: The final compiler directive is not allowed in function scope [...]
Looks like you'll need 0.16 (i.e. the latest git version) of Cython for the latest lxml master branch. It's close to release (certainly closer than lxml 2.4) and should be stable enough for general use.
Aha! You might update the minimum cython version at http://lxml.de/build.html#cython.
It's already updated on github. Stefan
participants (3)
-
Jeffrey Yasskin
-
Laurence Rowe
-
Stefan Behnel