I have a very simply cython module called empty_test.pyx:
cimport numpy as cnp
cpdef return_empty():
return cnp.empty(0, dtype=np.int32)
When I try to run return_empty I get this error:
empty_test.pyx:5:14: cimported module has no attribute 'empty'
This is my setup.py file:
from distutils.core import setup
from Cython.Build import cythonize
import numpy as np
setup(
ext_modules=cythonize(['empty_test.pyx'],
),
include_dirs = [np.get_include()],
)
I'm aware that I could try import numpy as np instead of cimport numpy as np, but I'm trying to use C versions of the numpy code.