Setuptools tries to import Cython.Distutils.bdist_ext to determine if Cython is available (cf https://bitbucket.org/pypa/setuptools/src/626b55107cf96e6872a859f5c759458b01907d26/setuptools/command/build_ext.py?at=default#build_ext.py-13). However, this method is unreliable: if Cython has been installed for the regular Python interpreter, but setup.py runs under the debug interpreter, importing Cython.Distutils.bdist_ext succeeds (because it involves only .py files), but importing Cython.Compiler fails (because there is no extension module for the debugging interpreter). This then causes errors when setuptools tries to use Cython.
Would it be possible to import Cython.Compiler in Cython.Distutils.bdist_ext, so that it's assured that Cython is installed and working if the import of build_ext succeeds?
Setuptools tries to import
Cython.Distutils.bdist_ext
to determine if Cython is available (cf https://bitbucket.org/pypa/setuptools/src/626b55107cf96e6872a859f5c759458b01907d26/setuptools/command/build_ext.py?at=default#build_ext.py-13). However, this method is unreliable: if Cython has been installed for the regular Python interpreter, but setup.py runs under the debug interpreter, importingCython.Distutils.bdist_ext
succeeds (because it involves only .py files), but importingCython.Compiler
fails (because there is no extension module for the debugging interpreter). This then causes errors when setuptools tries to use Cython.Would it be possible to import
Cython.Compiler
inCython.Distutils.bdist_ext
, so that it's assured that Cython is installed and working if the import ofbuild_ext
succeeds?Migrated from http://trac.cython.org/ticket/859