문제

I have a directory structure as so:

/my_module

init.py

A/

  __init__.py

  a.pyx

B/

  __init__.py

  b.pyx

In b.pyx I want to cimport functions from A.a. A regular python import works, but a cimport always fails.

Also, I'm compiling A/ and B/ separately because I couldn't figure out how to put a setup.py in the top module.

Can anyone help here?

도움이 되었습니까?

해결책

You have to create a cython declaration file, a .pxd

It shall contain only declarations of classes and functions that you want to import.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top