ModuleNotFound在同一目录中导入模块时出错

2024-09-25 12:33:46 发布

您现在位置:Python中文网/ 问答频道 /正文

我重组了我的程序,现在我得到以下错误:

Traceback (most recent call last):
  File "scraper.py", line 20, in <module>
    from Scraper.Programm.format import Formatter
ModuleNotFoundError: No module named 'Scraper'

这在scraper.py中发生:

import json
import os
import sys
from itertools import islice
from typing import Dict, List, Optional
from Scraper.Programm.format import Formatter

我的项目结构如下所示:

enter image description here

我做错了什么


Tags: frompyimport程序formatmostformatter错误