【发布时间】:2019-11-24 19:22:35
【问题描述】:
我在 python 中导入时遇到了一些问题。我不太明白为什么会出现错误。
我正在使用目录笔记本中的 jupyter 笔记本。我需要导入位于source/prepare_data.py 的函数prepare_data
为了导入,我尝试使用from ..source.prepare_data import prepare_data
在这里https://docs.python.org/3/reference/import.html(第 5.7 段)和 python 向我显示错误“尝试相对导入超出顶级包”。
【问题讨论】:
-
请分享您的代码以及错误信息
标签: python python-3.x import python-import