โŒ

Normal view

There are new articles available, click to refresh the page.
Before yesterdayMain stream

Facing 'ModuleNotFoundError' Even Though Module Exists in Same Parent Directory

When I run train_pipeline.py:

from zenml import pipeline

from steps.ingest_data import ingest_df
from steps.clean_data import clean_df
from steps.model_train import train_model
from steps.evaluation import evaluate_model



@pipeline
def train_pipeline(data_path: str):
    df = ingest_df(data_path)
    clean_df(df)
    train_model(df)
    evaluate_model(df)

I am getting an error:

โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ Traceback (most recent call last) โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
โ”‚ path\to\file\pipelines\training_pipeline.py:2 in <module>        โ”‚
โ”‚                                                                                                  โ”‚
โ”‚    1 from zenml import pipeline                                                                  โ”‚
โ”‚ โฑ  2 from steps.ingest_data import ingest_df                                                     โ”‚
โ”‚    3 from steps.clean_data import clean_df                                                       โ”‚
โ”‚    4 from steps.model_train import train_model                                                   โ”‚
โ”‚    5 from steps.evaluation import evaluate_model                                                 โ”‚
โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ
ModuleNotFoundError: No module named 'steps'
โ””โ”€โ”€ Parent-Directory/
    โ”œโ”€โ”€ idea
    โ”œโ”€โ”€ .zen
    โ”œโ”€โ”€ data/
    โ”‚   โ””โ”€โ”€ data.csv
    โ”œโ”€โ”€ pipelines/
    โ”‚   โ””โ”€โ”€ training_pipeline.py
    โ”œโ”€โ”€ saved_models/
    โ”œโ”€โ”€ src/
    โ”‚   โ”œโ”€โ”€ steps/
    โ”‚   โ”‚   โ”œโ”€โ”€ __pycache__
    โ”‚   โ”‚   โ”œโ”€โ”€ __init__.py
    โ”‚   โ”‚   โ”œโ”€โ”€ clean_data.py
    โ”‚   โ”‚   โ”œโ”€โ”€ evaluation.py
    โ”‚   โ”‚   โ”œโ”€โ”€ ingest_data.py
    โ”‚   โ”‚   โ””โ”€โ”€ model_train.py
    โ”œโ”€โ”€ venv/
    โ””โ”€โ”€ __init__.py
    โ””โ”€โ”€ .gitignore
    โ””โ”€โ”€ LICENSE
    โ””โ”€โ”€ README.md
    โ””โ”€โ”€ run_pipeline.py

This is my directory structure.

I added the path in sys.path. I can see the path after I have added the path. Still getting the same error

Python version - 3.10.11 Windows version - 11

โŒ
โŒ