即使使用init .py也会出现错误“尝试在非包中进行相对导入” 。pkg/ __init__.py conf/ core.py __init__.py scripts/ core_script.py __init__.py在 core_script.py 我有以下导入语句from ..conf.core import gDocsCred但是,当我运行时,我收到以下错误:scripts$ python core_test.py Traceback (most recent call last): File "core_script.py", line 3, in <module> from ..conf.core import gDocsCredValueError: Attempted relative import in non-package
添加回答
举报
0/150
提交
取消