I installed speech recognition

pip install SpeechRecognition

ran this

import speech_recognition as sr
r = sr.Recognizer()

with sr.Microphone() as source:
    audio = r.listen(source)


and got this error

Traceback (most recent call last):
    import speech_recognition as sr
ImportError: No module named 'speech_recognition'
  • did you figure this out ? if yes can you share with us please? Dec 19, 2019 at 7:42
  • Yes, my problem was I didn't specify python 3, pip3 install SpeechRecognition worked for me.
    – DYD
    Dec 20, 2019 at 18:05

3 Answers 3


Your tag says python3. If you are running your code in python3 you need to install speechrecognition with pip3.


As T. M.'s answers points out you need to make sure that the modules are installed for the Python version you are using.

If you're running several version of Python and pip you might want to check that you are using the corresponding pip version. It might look like this:

# python --version
Python 3.7.1
# pip --version
pip 18.0 from /usr/lib/python3.7/site-packages/pip (python 3.7)

If pip --version returns something not reading "(python 3.x)" you should use pip3 to install modules for Python3. However, since End of Life for Python 2.7 is coming any sane distribution would want pip to be pip3.


Firstly I would check to see if the file it's trying to access is in the folder that it's suppose to be in. Next if that all checks out look at the version of Python you are using and the version it's suppose to work on.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.