I recently worked on a python project where I need to import some .pyx
files.
However, I had a hard time import it as .pyx
and compile it with the following lines:
import pyximport
pyximport.install()
from . import kl
The error is
fatal error: capsule.h: No such file or directory
And in the kl.pyx
file, capsule.h
is used as following:
cdef extern from "capsule.h":
void* Capsule_AsVoidPtr(object ptr)
I am not sure what I should do. Please help me a little bit.
Alternatively, is it possible that the python script could import compiled .c
(in Linux) file directly, instead of importing .pyx
and compile it?
When I compile it with command line, it is compiled successfully, but I don't know how my IDE (PyCharm) could import that .c
file.
Thank you very much.
you missed some library, you need to install the source code of capsule.h.