I've got a project and my files are structured in this way:
-signals (folder)
|--movingaverage (folder)
|--movingaverage.py
-main2.py
-helper (folder)
|--csvmanager.py
code in: main2.py
from signals.movingaverage.movingaverage import *
print("start")
get_ma_chart_plotpoint()
code in: movingaverage.py
def get_ma_chart_plotpoint():
print("hello from get_ma_chart_plotpoint")
code in: csvmanager.py
import csv
def say_hello_csv():
print("hello from say_hello_csv")
When I run the main2.py I get this error message from the console:
runfile('E:/Coding/Repos/Tr.Py.Candlestick.DbFetcher/main2.py', wdir='E:/Coding/Repos/Tr.Py.Candlestick.DbFetcher')
Traceback (most recent call last):
File "E:\Coding\Repos\Tr.Py.Candlestick.DbFetcher\main2.py", line 1, in <module>
from signals.movingaverage.movingaverage import *
ModuleNotFoundError: No module named 'signals.movingaverage.movingaverage'
I'm running the program from main2.py. Is my import definition in main2.py not correct? what is wrong with it?
The odd thing is that when I change the main2.py to call a function in csvmanager.py file it works. Can't understand why? I've basically imported it in the same way.
update main2.py
from helper.csvmanager import *
print("start")
say_hello_csv()