Cython compiled C extension: ImportError: dynamic module does not define init function

I’ve found that a frequent cause of this problem is, when using a distutils setup file to compile the code, that the .pyx base name does not match the extension name, e.g:

ext = Extension(name="different", sources=['cython_ext.pyx']) # Won't work

To avoid the problem the extension name should be exactly the same, in this case, cython_ext.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)