I've got the following project structure:
When I run main.py
from my IDE everything seems to work fine.
When I try and run main.py
from the terminal I get the following error:
I have absolutely no idea why this is happening.
I thought that since I'm running it from the SmartHome1
directory then the import of from SpeechRecognition.TextToSpeech ...
should work (since the import is correct relative to the project root). Why then am I getting this error?
At first I thought the weather.py might "think" that the cwd is different than the project root. So I checked it using os.getcwd() and it showed that it is the root. I'm stumped.
So what am I doing wrong here?
Edit: Now when I think about it, it probably has to do with the fact that weather.py
is run as a standalone script using subprocess.Popen
. I'm still not sure how to fix this though.