Skip to content Skip to sidebar Skip to footer

Pyttsx: AttributeError: 'module' Object Has No Attribute 'init'

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):

Solution 1:

After importing the pyttsx module:

import pyttsx

use the command

dir(pyttsx)

Your output would be something as

['Engine',
 '__builtins__',
 '__doc__',
 '__file__',
 '__name__',
 '__package__',
 '__path__',
 '_activeEngines',
 'driver',
 'drivers',
 'engine',
 'init',
 'weakref']

(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.


Solution 2:

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


Post a Comment for "Pyttsx: AttributeError: 'module' Object Has No Attribute 'init'"