pyttsx3 icon indicating copy to clipboard operation
pyttsx3 copied to clipboard

ModuleNotFoundError: No module named 'Foundation'

Open Shubham1993 opened this issue 6 years ago • 3 comments


KeyError Traceback (most recent call last) ~/anaconda3/lib/python3.7/site-packages/pyttsx3/init.py in init(driverName, debug) 43 try: ---> 44 eng = _activeEngines[driverName] 45 except KeyError:

~/anaconda3/lib/python3.7/weakref.py in getitem(self, key) 136 self._commit_removals() --> 137 o = self.datakey 138 if o is None:

KeyError: None

During handling of the above exception, another exception occurred:

ModuleNotFoundError Traceback (most recent call last) in () 1 import pyttsx3 ----> 2 engine = pyttsx3.init() 3 engine.say("I will speak this text") 4 engine.runAndWait()

~/anaconda3/lib/python3.7/site-packages/pyttsx3/init.py in init(driverName, debug) 44 eng = _activeEngines[driverName] 45 except KeyError: ---> 46 eng = Engine(driverName, debug) 47 _activeEngines[driverName] = eng 48 return eng

~/anaconda3/lib/python3.7/site-packages/pyttsx3/engine.py in init(self, driverName, debug) 50 @type debug: bool 51 ''' ---> 52 self.proxy = driver.DriverProxy(weakref.proxy(self), driverName, debug) 53 # initialize other vars 54 self._connects = {}

~/anaconda3/lib/python3.7/site-packages/pyttsx3/driver.py in init(self, engine, driverName, debug) 73 # import driver module 74 name = 'pyttsx3.drivers.%s' % driverName ---> 75 self._module = importlib.import_module(name) 76 # build driver instance 77 self._driver = self._module.buildDriver(weakref.proxy(self))

~/anaconda3/lib/python3.7/importlib/init.py in import_module(name, package) 125 break 126 level += 1 --> 127 return _bootstrap._gcd_import(name[level:], package, level) 128 129

~/anaconda3/lib/python3.7/importlib/_bootstrap.py in _gcd_import(name, package, level)

~/anaconda3/lib/python3.7/importlib/_bootstrap.py in find_and_load(name, import)

~/anaconda3/lib/python3.7/importlib/_bootstrap.py in find_and_load_unlocked(name, import)

~/anaconda3/lib/python3.7/importlib/_bootstrap.py in _load_unlocked(spec)

~/anaconda3/lib/python3.7/importlib/_bootstrap_external.py in exec_module(self, module)

~/anaconda3/lib/python3.7/importlib/_bootstrap.py in _call_with_frames_removed(f, *args, **kwds)

~/anaconda3/lib/python3.7/site-packages/pyttsx3/drivers/nsss.py in () 1 ----> 2 from Foundation import * 3 from AppKit import NSSpeechSynthesizer 4 from PyObjCTools import AppHelper 5 from ..voice import Voice

ModuleNotFoundError: No module named 'Foundation'

Shubham1993 avatar Oct 22 '18 10:10 Shubham1993

pip install pyobjc

yrik avatar Nov 14 '18 21:11 yrik

I comanded "pip install pyobjc" but it was not solution.. maybe, is there other solutions???

JSPlike avatar May 01 '19 19:05 JSPlike

Does this issue have something to do with the operating system? I'm facing this issue on windows.

HemanthSai7 avatar Oct 02 '21 17:10 HemanthSai7