title: AttributeError: 'module' object has no attribute 'Recognizer'
body: <p>I'm using python's <a href="https://pypi.python.org/pypi/SpeechRecognition/" rel="nofollow">Speach Recognition</a> and my code is giving me an <code>AttributeError</code>:</p>
  
  <pre><code>import os
  import pyaudio
  import speech_recognition as sr
  
  def excel():
          os.system("start excel.exe")
  
  def internet():
          os.system("start chrome.exe")
  
  def media():
          os.system("start wmplayer.exe")
  
  def mainfunction(source):
      audio = r.listen(source)
      user = r.recognize_google(audio)
      print(user)
      if user == "Excel":
          excel()
      elif user == "Internet":
          internet()
      elif user == "music":
          media()
  
  if __name__ == "__main__":
      r = sr.Recognizer()    #this is the line that fails
      with sr.Microphone() as source:
          while 1:
              mainfunction(source)
  </code></pre>
  
  <p>the error message is:</p>
  
  <pre><code>AttributeError: 'module' object has no attribute 'Recognizer'
  (test-dev-pro)➜  ~  python speech_recognition.py
  Traceback (most recent call last):
    File "speech_recognition.py", line 26, in &lt;module&gt;
      r = sr.Recognizer()
  AttributeError: 'module' object has no attribute 'Recognizer'
  </code></pre>
  
  <p>but <code>Recognizer</code> is used in all the examples I have looked at so I don't understand why I am getting this error.</p>