Quantcast
Channel: Active questions tagged python - Stack Overflow
Viewing all articles
Browse latest Browse all 23131

Module Not Found - when using an imported function

$
0
0

This is my file structure

root|- src|  |-bot|  | |-conf|  | | |-data.py|  | |-model.py |- main.py

Code for my model.py

from conf.data import old_datadef somemodel(new_data):  old_data += new_data  (more working with data)

The code I am running in main.py

from src.bot.model import somemodeldef main():  somemodel(new_data)

What I am trying to do is, build a model with some data and then use that model in my main.py file.

When importing data from data.py in model.py, everything works fine. But when I am trying to import somemodel function in main.py, I am getting the error:

ModuleNotFoundError: No module named 'conf'

I tried everything but nothing seems to work. Why is my code behaving in this manner? How do I fix it?


Viewing all articles
Browse latest Browse all 23131

Trending Articles