Okay so I have been following a YouTube video on writing out this code and I am getting this error when I test run the program:
[File "C:/Users/Vladislaus/PycharmProjects/Morgana.py", line 5
except ImportError:
^
SyntaxError: invalid syntax]
The code is: [mport speech_recognition as sr
import pyttsx3
engine = pyttsx3.init()
except ImportError:
print('Requested driver is not found.')
except RuntimeError:
print('Driver fails to initialize.')]
I am not sure how the syntax has an error?
Can someone help me with this?
Thank you for your time.
[File "C:/Users/Vladislaus/PycharmProjects/Morgana.py", line 5
except ImportError:
^
SyntaxError: invalid syntax]
The code is: [mport speech_recognition as sr
import pyttsx3
engine = pyttsx3.init()
except ImportError:
print('Requested driver is not found.')
except RuntimeError:
print('Driver fails to initialize.')]
I am not sure how the syntax has an error?
Can someone help me with this?
Thank you for your time.