如何使用_init_.py修复“非包中的尝试相对导入”
pkg/ __init__.py components/ core.py __init__.py tests/ core_test.py __init__.py
core_test.py
from ..components.core import GameLoopEvents
tests$ python core_test.py Traceback (most recent call last): File "core_test.py", line 3, in <module> from ..components.core import GameLoopEventsValueError: Attempted relative import in non-package
慕沐林林
相关分类