import pyttsx works in python 2.7, but not in python3

I attempted to install pyttsx on Python 3.4 (on Windows). Here's what I discovered:

The pyttsx found on PyPi was developed by Peter Parente on GitHub.

Parente has abandoned further development, and never ported it to Python 3. I cannot even get his version to install on Python 3. I am not sure how you managed this.

A user called James Percent forked it and made a fairly minimal attempt to make it Python 3 compatible.

I found that attempt didn't go far enough, because - while I could install it and even import pyttsx successfully, when I tried to call pyttsx.init() it would do a dynamic import of a driver, and fail with an import error.

I made a further fork to fix that, which I will submit to James Percent. With those changes in place, I am able to run @Khanrad's test script.


I believe you are looking for the library:

pyttsx3

This python3 compatible version is now packaged in pypi and works pretty well for both python2 and python3 and as far as i have tested , it didn't give any error.

just use :

pip install pyttsx3

Usage :

import pyttsx3
engine = pyttsx3.init()
engine.say("I am talking now ");
engine.setProperty('rate',100)  
engine.runAndWait();