title: Why does my code provide an error when I try getting it to speak what it recognized?
body: <p>I'm experimenting with speech on Python3, I'm very new with python and I have scoured all of the internet to understand what's wrong with my code, when I run the code I get the error you can see below. Please help me understand what's happening better. </p>
  
  <p>Here is my code:</p>
  
  <pre><code>import speech_recognition as sr
  import time
  import pyttsx3
  
  r = sr.Recognizer()
  
  with sr.Microphone() as mic:
      print("Say something")
      audio = r.listen(mic)
      print("Recording Stopped")
  r.recognize_google(audio)
  
  
  
  
  
  
  if r.recognize_google(audio) == "I'm pretty" or r.recognize_google(audio) == "I am pretty" :
      engine = pyttsx3.init()
      engine.say("You said: I'm Ugly")
      engine.runAndWait()
  else:
      engine = pyttsx3.init()
      engine.say("You said: " + r.recognize_google(audio))
      engine.runAndWait()
  </code></pre>
  
  <p>Here is the error message:</p>
  
  <pre><code>Last login: Sat Feb 16 18:03:26 on ttys002
  ErenUcar-3:~ eucar$  python /Users/eucar/.atom/packages/atom-python-run/lib/../cp/main.py --pause -- python3 /Users/eucar/Documents/Testing/noob.py
  
  
  Say something
  Recording Stopped
  Traceback (most recent call last):
    File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/pyttsx3/__init__.py", line 44, in init
      eng = _activeEngines[driverName]
    File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/weakref.py", line 137, in __getitem__
      o = self.data[key]()
  KeyError: None
  
  During handling of the above exception, another exception occurred:
  
  Traceback (most recent call last):
    File "/Users/eucar/Documents/Testing/noob.py", line 23, in &lt;module&gt;
      engine = pyttsx3.init()
    File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/pyttsx3/__init__.py", line 46, in init
      eng = Engine(driverName, debug)
    File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/pyttsx3/engine.py", line 52, in __init__
      self.proxy = driver.DriverProxy(weakref.proxy(self), driverName, debug)
    File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/pyttsx3/driver.py", line 75, in __init__
      self._module = importlib.import_module(name)
    File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/importlib/__init__.py", line 127, in import_module
      return _bootstrap._gcd_import(name[level:], package, level)
    File "&lt;frozen importlib._bootstrap&gt;", line 1006, in _gcd_import
    File "&lt;frozen importlib._bootstrap&gt;", line 983, in _find_and_load
    File "&lt;frozen importlib._bootstrap&gt;", line 967, in _find_and_load_unlocked
    File "&lt;frozen importlib._bootstrap&gt;", line 677, in _load_unlocked
    File "&lt;frozen importlib._bootstrap_external&gt;", line 728, in exec_module
    File "&lt;frozen importlib._bootstrap&gt;", line 219, in _call_with_frames_removed
    File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/pyttsx3/drivers/nsss.py", line 2, in &lt;module&gt;
      from Foundation import *
  ModuleNotFoundError: No module named 'Foundation'
  
  Process returned 1 (0x1)    execution time : 10.702 s
  Close this window to continue...
  ErenUcar-3:~ eucar$ 
  </code></pre>