我正在从 main.py 运行代码。以下是我的目录结构:
我正在使用 Python 3.6 和 Linux。
PackA
PackB
PackC
_main.py
PackD
cython_file.pyx
def func() # function defined here.
cython_file.pxd
__init__.py
func() # function call.
安装包 pyximport 由 Cython 使用。
我正在__init__.py
使用以下方法导入 cython 文件:
from cython_file import func
错误:ImportError:无法导入名称“func”
我在哪里做错了?