我正在开发一个涉及车道检测的Python项目,我的项目结构如下图所示。
我正在尝试使用以下代码从
lanenet_model
中的 test_lanenet.py
导入模块:
蟒蛇
import sys
sys.path.append('C:/Users/SaiTeja/PycharmProjcts/NewGitCloneSDAI/Lanenet-lane-detection/lanenet_model')
from lanenet_model import lanenet
但是,我遇到了
ModuleNotFoundError:
回溯(最近一次调用最后一次): 文件“C:\Users\SaiTeja\PycharmProjects\NewGitCloneSDAI\lanenet-lane-detection ools est_lanenet.py”,第 23 行,位于 从 Lanenet_model 导入 Lanenet ModuleNotFoundError:没有名为“lanenet_model”的模块
vbnet
ModuleNotFoundError: No module named 'Lanenet_model'
我已确认
__init__.py
存在于 lanenet_model
目录中,使其成为一个包,并且我已检查我附加到 sys.path
的路径是否正确。
这是我迄今为止尝试过的:
sys.path.append()
中的路径正确并指向lanenet_model
上方的目录。__init__.py
是否存在于 lanenet_model
目录中。