I'm trying to us a multiprocessing script to run two python scripts at the same time. The problem I'm having is that when I run the script I end up with an import error for a number of modules in the other two scripts. I've tried various other ways of running these two scripts and this seems to be the best way.
This is for a degree project which involves natural language processing, text to speech and speech to text, so the modules I'm using are nltk, google.cloud.speech, playsound and a few others. Here is my code:
import os
from multiprocessing import Process
def intent():
os.system('IntentDetection.py')
def speak():
os.system('TextToSpeech.py')
if __name__ == '__main__':
p = Process(target=intent())
q = Process(target=speak())
p.start()
q.start()
I'm expecting for it to run both scripts so that I can talk to the system, it interprets the text and then speaks back. All the scripts are working on their own I just can't get them to run together. This is the error I get:
Traceback (most recent call last):
File "IntentDetection.py", line 2, in <module>
import nltk
ImportError: No module named nltk
Traceback (most recent call last):
File "TextToSpeech.py", line 2, in <module>
from playsound import playsound
ImportError: No module named playsound
Any help would be greatly appreciated.