Hi to everyone and thanks in advance
import pyttsx
engine = pyttsx.init()
engine.say('Hello World')
engine.runAndWait()
And I get this error:
Traceback (most recent call last):
File "C:\Users\xxx\eclipse\workspace\Ai_Project\AI\Ai_Brain.py", line 8, in <module>
engine = pyttsx.init()
AttributeError: 'module' object has no attribute 'init'
I am on Windows 7 using Python 2.7 and eclipse neon. Is this some kind of compatibility issue? I have searched a lot of related questions but applying the answers on my case didn't fix the error
After importing the
pyttsx
module:use the command
Your output would be something as
(see
'init'
in it near the end).I guess your output will be different - it will reveal which module you actually imported regardless of its name
pyttsx
.Fairly easy i guess and i post the answer in case someone in future has the same problem and every query he/she made didn't work. Consider this a human error and check your compatibility issues. In my case problem was that instead of pywin32-py2.7.exe i installed pywin32-219.win-amd64-py2.7.
Thanks to everyone who read or answered my question