Compiling an optional cython extension only when possible in setup.py
问题 I have a python module fully implemented in python. (For portability reasons.) The implementation of a small part has been duplicated in a cython module. To improve perfomance where possible. I know how to install the .c modules created by cython with distutils . However if a machine has no compiler installed, I suspect the setup will fail even though the module is still usable in pure python mode. Is there a way to compile the .c module if possible but fail gracefully and install without it