没有名为错误的模块如何从植根于同一目录的不同目录中的python中的.pyx文件导入函数?

问题描述

我正在从main.py运行代码。以下是我的目录结构:

我正在使用Python 3.6和Linux。

cat backup.sql | docker exec -i MysqL /usr/bin/MysqL -u root --password=passwd123 DATABASE

Cython已安装软件包pyximport。

我正在使用以下命令在public static void main(String[] args) { String str = "Howdy"; int characterLoc = 0; int repCount = str.length(); while (characterLoc < str.length()) { for (int x = repCount; x > 0; x--) { System.out.print(str.charat(characterLoc)); } characterLoc++; repCount--; System.out.println(); } } 中导入cython文件

PackA
     PackB
          PackC
               _main.py
          PackD 
               cython_file.pyx
                         def func()   # function defined here. 
               cython_file.pxd
               __init__.py   
                     func()           # function call. 

错误:ImportError:无法导入名称'func'

我在哪里做错了?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)