[Cython] Cython fails to build if pgen is available

Robert Bradshaw robertwb at gmail.com
Wed Aug 19 00:52:59 CEST 2015


On Tue, Aug 18, 2015 at 3:02 PM, Dominic Sacré <dominic.sacre at gmx.de> wrote:
> Hi,
>
> I'm getting the following error trying to build Cython 0.23:
>
> Cython/Parser/Grammar: No such file or directory
> Traceback (most recent call last):
>   File "setup.py", line 289, in <module>
>     compile_cython_modules(cython_profile, cython_compile_more,
> cython_with_refnanny)
>   File "setup.py", line 135, in compile_cython_modules
>     os.path.join(parser_dir, 'graminit.c'),
>   File
> "/data/master/build/tmp/sysroots/x86_64-linux/usr/lib/python2.7/subprocess.py",
> line 540, in check_call
>     raise CalledProcessError(retcode, cmd)
> subprocess.CalledProcessError: Command
> '['/data/master/build/tmp/sysroots/x86_64-linux/usr/bin/python-native/pgen',
> 'Cython/Parser/Grammar', 'Cython/Parser/graminit.h',
> 'Cython/Parser/graminit.c']' returned non-zero exit status 1
>
> The toolchain is based on OpenEmbedded, and unlike most distribution
> packages, its Python installation actually contains pgen.
>
> Where would that Cython/Parser/Grammar file come from?
> Alternatively, is there a clean way (without patching setup.py) to skip
> compiling the grammar?

The grammar is here: https://github.com/cython/cython/tree/master/Cython/Parser

Looks like eveyone who tried to use this did so from a git clone, not
the sdist. Omission fixed:
https://github.com/cython/cython/commit/969de4eab048896c6f29b9251dc4324309a1abb4
Either patch this in/distribute these files or patch setup.py.


More information about the cython-devel mailing list