1

I am using powershell and scoop, windows. I already installed speech_recognition bucket but still showing the error.

Code:
import speech_recognition as sr
import time
import json
import requests
import thread
import subprocess

SPLUNK_URL = "https://localhost"
# Splunk http event collector token
hec_token = "" 
Bhargav Rao
  • 50,140
  • 28
  • 121
  • 140
satwik
  • 29
  • 1
  • 7
  • Did you install for the correct version of python? i.e. is the version you installed it for the same you are running that code with? – T Bell Oct 06 '18 at 03:54
  • I have installed latest 3.7 version and trying to run with this. The code snippet was built 2 years ago and am trying to improve the features. – satwik Oct 06 '18 at 12:12

1 Answers1

2

The python interpreter shows a ModuleNotFoundError when it can't find the module being imported. For more information on how import works, click here.

Since you have installed latest python 3.7, and are working on a code snippet that was built 2 years ago, there is likely a case that the speech_recognition module might not be installed for your current python.

Before you try anything, execute

pip list

and see all the modules currently installed for your current python interpreter. If the speech_recognition module is not available in the list, then install it:

pip install SpeechRecognition

Also, if you are having multiple python versions installed on your system then make sure you use the pip installer of the python interpreter that you are using for your application. If you are using or like having multiple python versions, then I suggest you use a tool like pyenv.

Dhruv Joshi
  • 713
  • 7
  • 10