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

David Cournapeau cournape at
Thu Aug 6 13:00:09 CEST 2009

On Thu, Aug 6, 2009 at 7:38 PM, Diez B. Roggisch<deets at> wrote:
> Hi,
> 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.
> This is my
> ----
> import os
> import glob
> from setuptools import setup, Extension
> #from distutils.core import setup
> #from distutils.extension import Extension
> from Cython.Distutils import build_ext

What happens if you import setuptools *after* Cython.distutils ? My
guess - I could be wrong - is that both Cython.distutils and
setuptools monkey-patch distutils, and that setuptools does not "see"
Cython.Distutils. It could also be an incompatibility between
Cython.Distutils and setuptools (the design of distutils forces you to
take into account the details of things modified by every distutils



More information about the Python-list mailing list