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

前端 未结 8 1419
盖世英雄少女心
盖世英雄少女心 2020-12-12 23:48

I have just compiled part of my C library as an extension using Cython, as a \"proof of concept\". I managed to hack the code (const correctnes problems etc aside), to final

相关标签:
8条回答
  • 2020-12-13 00:34

    I had the same error and was solved by running the main .py script in "Execute in a dedicated console " mode. Available in Tools - Preferences - Run.

    0 讨论(0)
  • 2020-12-13 00:46

    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.

    0 讨论(0)
提交回复
热议问题