3

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?

4

1 回答 1

3

您必须创建一个 cython 声明文件,一个 . 像素

它应仅包含您要导入的类和函数的声明。

于 2011-09-06T17:16:14.373 回答