cythonize动态模块没有定义模块导出功能

时间:2018-02-09 20:56:00

标签: python cython cythonize

$ cythonize -a -i hello.pyx

running build_ext
building 'hello' extension
...

现在我有一个hello.so文件,以及其他文件(hello.pyx,hello.c)

然后我尝试导入该功能:

$ python
Python 3.5.3 |Continuum Analytics, Inc.| (default, Mar  6 2017, 11:58:13) 
[GCC 4.4.7 20120313 (Red Hat 4.4.7-1)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import hello
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: dynamic module does not define module export function (PyInit_hello)
>>> 

我知道之前已经问过这个问题(链接如下),但似乎解决方案是运行python3,我已经在做了,所以我不知道如何解决我的问题 Cython Compilation Error: dynamic module does not define module export function

我应该添加我正在使用的cythonize版本: $ cython --version Cython版本0.24

0 个答案:

没有答案
相关问题