简体   繁体   English

ModuleNotFoundError:没有名为 python 的模块

[英]ModuleNotFoundError: No module named python

I got an error.我有一个错误。 I created a module and it recognize it everywhere but did not work when i trined to import it in seedlingsWidget.py .我创建了一个模块,它在任何地方都可以识别它,但是当我尝试将它导入到中时却没有工作 seedlingsWidget.py 。 I tried some solutions but nothing worked.我尝试了一些解决方案,但没有任何效果。 I tried to add init .py in every directory.我试图在每个目录中添加init .py 。 I tried to add the path of the directory to sys.path.append我试图将目录的路径添加到sys.path.append

在此处输入图像描述

在此处输入图像描述

from models.seedlings import Seedlings

how can I fix that?我该如何解决? I will be happy for some help, thank you我很乐意为您提供帮助,谢谢

尝试

from models.seedlingsType import SeedlingsType

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM