Cython Compilation Error: dynamic module does not define module export function

前端 未结 3 439
轮回少年
轮回少年 2020-12-06 05:22

I am building a package in Cython. I am using the following as the structure for setup.py:

from distutils.core import setup
from distutils.exten         


        
3条回答
  •  情深已故
    2020-12-06 05:37

    You need to call setup.py with Python 3 (python3 setup.py build_ext, maybe --inplace). It's because Python 3 defines a different name for the init function called when the module starts, and so you need to build it using Python 3 to ensure the correct name is generated.

    See dynamic module does not define init function (PyInit_fuzzy) and How to specify Python 3 source in Cython's setup.py? for slightly more detail (it's bordering on a duplicate of these questions, but isn't quite in my view)

提交回复
热议问题