简体   繁体   English

ModuleNotFoundError:没有名为“ speech_recognition”的模块

[英]ModuleNotFoundError: No module named 'speech_recognition'

I am using powershell and scoop, windows. 我正在使用Powershell和勺子,窗户。 I already installed speech_recognition bucket but still showing the error. 我已经安装了Speech_recognition存储桶,但仍然显示错误。

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 = "" 

The python interpreter shows a ModuleNotFoundError when it can't find the module being imported. 当找不到解释的模块时,python解释器将显示ModuleNotFoundError。 For more information on how import works, click here . 有关import如何工作的更多信息,请单击此处

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. 由于您已经安装了最新的python 3.7,并且正在使用2年前构建的代码段,因此可能有可能未为当前python安装Speech_recognition模块。

Before you try anything, execute 在尝试任何事情之前,执行

pip list

and see all the modules currently installed for your current python interpreter. 并查看当前为当前python解释器安装的所有模块。 If the speech_recognition module is not available in the list, then install it: 如果speech_recognition模块在列表中不可用,则安装它:

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. 另外,如果您的系统上安装了多个python版本,请确保使用用于应用程序的python解释器的pip安装程序。 If you are using or like having multiple python versions, then I suggest you use a tool like pyenv . 如果您正在使用或喜欢具有多个python版本,则建议您使用pyenv之类的工具。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 ModuleNotFoundError:没有名为“speech_recognition”的模块(Windows 计算机) - ModuleNotFoundError: No module named 'speech_recognition' (windows COMPUTER) Python 中没有名为“speech_recognition”的模块 - No module named 'speech_recognition' in Python ImportError:python IDLE 中没有名为“speech_recognition”的模块 - ImportError: No module named 'speech_recognition' in python IDLE 我没有安装名为“Speech_Recognition”的模块,但仍然显示找不到模块 - No module named 'Speech_Recognition' I have installed but still showing module not found python speech_recognition模块占用麦克风 - python speech_recognition module occupies microphone 语音识别:AttributeError:模块“ speech_recognition”没有属性“ Recognizer” - Speech Recognition: AttributeError: module 'speech_recognition' has no attribute 'Recognizer' speech_recognition无法导入pyaudio; ModuleNotFoundError - speech_recognition can't import pyaudio; ModuleNotFoundError 属性错误:模块“ speech_recognition”没有属性“ Recognizer” - Attribute error:module 'speech_recognition' has no attribute 'Recognizer' 如何使用 Speech_recognition 修复模块导入错误? - How to fix Module Import Error with speech_recognition? 使用语音识别模块 PYTHON 中的麦克风()时出错 - Error using Microphone() from speech_recognition module PYTHON
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM