Cython + setuptools not working with .pyx,only with .c-files

Diez B. Roggisch deets at nospam.web.de
Mon Aug 10 06:52:26 EDT 2009


Stefan Behnel wrote:

> Diez B. Roggisch wrote:
>> I'm trying to build a Cython-extension as Egg.
>> 
>> However, this doesn't work - I can either use distutils to build the
>> extension, creating a myextension.c-file on the way.
>> 
>> If that's there, I can use setuptools to build the egg.
>> 
>> But when I remove the .c-file, the .pyx-file isn't used to re-generate
>> it.
> 
> setuptools monkeypatch into distutils to support Pyrex if it's installed,
> but most non-bleeding-edge versions do not know about Cython and thus
> break the Cython distutils support when Pyrex isn't there as well.
> 
> What helps is to put a fake Pyrex installation into your sys.path, like
> 
> http://codespeak.net/svn/lxml/trunk/fake_pyrex/
> 
> as done at the top of
> 
> http://codespeak.net/svn/lxml/trunk/setup.py

Thanks, that did the trick for us.

Diez



More information about the Python-list mailing list