I don't know how to phrase this question, but this is my main script:
master.py:
from terminal_module.output import Terminal as term
vterm = term()
This is the terminal output module (in relative directory
/terminal_module/output.py:
from voice_synthesis.tts import TTS
class Terminal:
print("INIT")
synth = TTS()
print("INIT FINISHED")
This is the TTS module (in relative directory from
master.py /terminal_module/voice_synthesis/tts.py:
import pyttsx3
class TTS:
engine = None
def __init__(self):
self.engine = pyttsx3.init()
def speak(self, text):
self.engine.say(text)
And if I run:
tts.py = Works as it exists almost immediately with no error
output.py = Works as it outputs INIT and then INIT FINISHED and exits with no error
master.py = Fails with the following error:
Traceback (most recent call last):
File "e:\0000_AI\GEN_1\ANNA\src\master.py", line 9, in <module>
from voice_terminal_module.voice_terminal import VoiceTerminal as VoiceTerminalModule
File "e:\0000_AI\GEN_1\ANNA\src\voice_terminal_module\voice_terminal.py", line 2, in <module>
from voice_synthesis_module_TEMP.tts import TTS
ModuleNotFoundError: No module named 'voice_synthesis_module_TEMP'
Why is this? I could probably implement the TTS class functionality into Terminal, but this project will be pretty big, so I would like to have as many classes as possible. Hope this makes sense, thanks!
What I have tried:
I have tried running each script independently and it all worked.