我有一个大致如下的文件系统:
> unit-testing
__init__.py
> hardware
__init__.py
test_All.py
> tests
__init__.py
scc.py
我正在尝试将scc.py
导入test_ALL.py
文件,如下所示:
from ..tests import scc
这将导致以下错误:
"ValueError: attempted relative import beyond top-level package"
这是令人惊讶的,因为this part of the Python 3.7.1 documentation有一个与我的代码语法相同的示例:
from ..filters import equalizer
所以我不确定为什么会发生这个错误,或者它到底意味着什么。有什么建议吗
目前没有回答
相关问题 更多 >
编程相关推荐