![]() |
Error with SpeechRecognition module - Printable Version +- Python Forum (https://python-forum.io) +-- Forum: Python Coding (https://python-forum.io/forum-7.html) +--- Forum: General Coding Help (https://python-forum.io/forum-8.html) +--- Thread: Error with SpeechRecognition module (/thread-28795.html) |
Error with SpeechRecognition module - glittergirl - Aug-03-2020 I am following this tutorial to transcribe audio. First, I installed all the modules and program before running python3 transcribe.py , and transcribe.py contains the following code.import speech_recognition as sr from os import path from pydub import AudioSegment # convert mp3 file to wav sound = AudioSegment.from_mp3("transcript.mp3") sound.export("transcript.wav", format="wav") # transcribe audio file AUDIO_FILE = "transcript.wav" # use the audio file as the audio source r = sr.Recognizer() with sr.AudioFile(AUDIO_FILE) as source: audio = r.record(source) # read the entire audio file print("Transcription: " + r.recognize_google(audio))When I run the python3 transcribe.py line in my terminal, I get the following error: I checked whether SpeechRecognition was properly installed using pip3 list , and it shows up on nthe list.I also checked the following: In any case, any help will be appreciated! Thanks!
RE: Error with SpeechRecognition module - Gribouillis - Aug-03-2020 At the beginning of the script, write import sys print(sys.executable) print(sys.version_info) print(sys.path) sys.exit(0)and post the output here. RE: Error with SpeechRecognition module - glittergirl - Aug-04-2020 (Aug-03-2020, 09:15 PM)Gribouillis Wrote: At the beginning of the script, write Thank you so much for responding! Here's the output:
RE: Error with SpeechRecognition module - Gribouillis - Aug-04-2020 Then why did pip3 install the package for python3.8 and not the python3.7 that you are using? You have two solutions, either you run the script with python3.8, either you install the package for python3.7 as well First option Second option
|