1

I am using Python3.7 on Win10. I would like to use Pyttsx but it shows an error. Do you have any idea how to fix the issue?

Error:

Traceback (most recent call last): File "C:\Python37\myTest\test.py", line 2, in import pyttsx File "C:\Python37\lib\site-packages\pyttsx__init__.py", line 18, in from engine import Engine ModuleNotFoundError: No module named 'engine'

test.py:

import pyttsx
engine = pyttsx.init()
engine.say('Good morning.')
engine.runAndWait()

init.py:

from engine import Engine

engine.py:

class Engine(object):
def __init__(self, driverName=None, debug=False):
Kobayashi
  • 25
  • 6

1 Answers1

2

try using pyttsx3 instead of pyttsx First install pyttsx3

pip install pyttsx3

and change the

import pyttsx

for

import pyttsx3

test.py:

import pyttsx3
engine = pyttsx3.init()
engine.say('Good morning.')
engine.runAndWait()
Senthuja
  • 520
  • 1
  • 7
  • 19
  • You refer this link "https://stackoverflow.com/questions/29615235/pyttsx-no-module-named-engine" to get more explanation. – Senthuja Mar 20 '19 at 13:14