-2

I installed a wsl2 kernel on Windows and pip installed SpeechRecognition, its the latest update as is python but it keeps telling me 'ModuleNotFoundError: No module named 'speech_recognition'.

import speech_recognition as sr

What could be the problem?

  • Perhaps you have other versions of python installed and the command line uses `pip` from one of those. You could search your file system for all the different installations of python. – quamrana Jun 22 '21 at 08:56
  • @quamrana How do I do that? – Justin Howard Jun 22 '21 at 09:01
  • Search for `pip.exe` – quamrana Jun 22 '21 at 09:04
  • 1
    Does this answer your question? [Python pip install module is not found. How to link python to pip location?](https://stackoverflow.com/questions/15052206/python-pip-install-module-is-not-found-how-to-link-python-to-pip-location) – Robin De Schepper Jun 22 '21 at 09:11

1 Answers1

0

If the module is not found then perhaps it was not installed correctly. How did you install SpeechRecognition?

Instead of pip though, you could try pip3 installing:

pip3 install --upgrade speechrecognition

For Jupyter notebook however, I have had to use:

!pip3 install --upgrade speechrecognition

then you can import as required and check the version:

import speech_recognition as sr
sr.__version__
R_Dax
  • 706
  • 3
  • 10
  • 25
  • @RobinDeSchepper Good point. I have edited my answer to remove the `sudo` install recommendation. – R_Dax Jun 22 '21 at 09:12