I understand that this question has been asked several times but after reading them, and making the suggested fixes, I\'m still stumped.
My project structure is as f
Yet another way to solve this without the path goes like this: consider the following code where inside your folder name 'app' you have 3 files x.py, y.py and an empty init.py. So to run x.py you have an import from y such that:
x.py
from app.y import say_hi
print ("ok x is here")
say_hi()
And
y.py
print ("Im Y")
def say_hi():
print ("Y says hi")
so the folder structure would look like this:
testpy
app
__init__.py
x.py
y.py
Solution: in the folder BEFORE app do the following:
$ python -m app.x
Note: I did not use x.py (simply app.x)
Result:
Nespresso@adhg MINGW64 ~/Desktop/testpy
$ python -m app.x
Im Y
ok x is here
Y says hi