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.pyimport numpy as np # Linear algebraimport pandas as pd # Data wranglingimport re # Regular expressionsimport 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'"