Skip to content Skip to sidebar Skip to footer

ModuleNotFoundError: No Module Named 'model'

I have a package with the following structure: model\ __init__.py (from model.main_trainer import *, etc.) main_trainer.py snn.py splitter.py The main_trainer.py s

Solution 1:

Append your script/module path with sys module then import your sub modules.

sys.path.append('/path/to/your/model/modules/')

Hope this will solve your problem.

Edit:

Modified your main_trainer file

#main_trainer.py

import numpy as np # Linear algebra
import pandas as pd # Data wrangling
import re # Regular expressions
import sys
import matplotlib


# Avoid plotting graphs
matplotlib.use('Agg')

# Custom dependencies
sys.path.append('/projects/cc/kdqm927/PythonNotebooks/model/') #folder which contains model, snn etc.,
from snn import *
from splitter import *

Post a Comment for "ModuleNotFoundError: No Module Named 'model'"