我将如何组织我的 python 导入,以便我可以拥有这样的目录。
project
| \
| __init__.py
|
src
| \
| __init__.py
| classes.py
|
test
\
__init__.py
tests.py
然后在/project/test/tests.py里面就可以导入classes.py了
我在 tests.py 中有这样的代码
from .. src.classes import(
scheduler
db
)
我得到了错误
SystemError: Parent module '' not loaded, cannot perform relative import
有谁知道该怎么做?