Установил библиотеку
SpeechRecognition и при запуске кода получаю ошибку:
Traceback (most recent call last):
File "F:\Code\python\Коти\main.py", line 3, in <module>
import SpeechRecognition
ModuleNotFoundError: No module named 'SpeechRecognition'
При попытке повторной установки:
Requirement already satisfied: SpeechRecognition in c:\users\тимур\appdata\local\programs\python\python312\lib\site-packages (3.10.4)
Requirement already satisfied: requests>=2.26.0 in c:\users\тимур\appdata\local\programs\python\python312\lib\site-packages (from SpeechRecognition) (2.32.3)
Requirement already satisfied: typing-extensions in c:\users\тимур\appdata\local\programs\python\python312\lib\site-packages (from SpeechRecognition) (4.12.2)
Requirement already satisfied: charset-normalizer<4,>=2 in c:\users\тимур\appdata\local\programs\python\python312\lib\site-packages (from requests>=2.26.0->SpeechRecognition) (3.3.2)
Requirement already satisfied: idna<4,>=2.5 in c:\users\тимур\appdata\local\programs\python\python312\lib\site-packages (from requests>=2.26.0->SpeechRecognition) (2.10)
Requirement already satisfied: urllib3<3,>=1.21.1 in c:\users\тимур\appdata\local\programs\python\python312\lib\site-packages (from requests>=2.26.0->SpeechRecognition) (2.2.2)
Requirement already satisfied: certifi>=2017.4.17 in c:\users\тимур\appdata\local\programs\python\python312\lib\site-packages (from requests>=2.26.0->SpeechRecognition) (2024.7.4)
Код:
import pyttsx3
import pyaudio
import SpeechRecognition
import wave
import datetime
import os
r = SpeechRecognition.Recognizer()
with SpeechRecognition.Microphone(device_index=1) as source:
audio = r.listen(source)
query = r.recognixe_google(audio, language="ru-RU")
print("[Пользователь] " + query.lower())
Подскажите, пожалуйста, как исправить.