简体   繁体   English

语音识别模块不工作,尽管被下载

[英]Speech Recognition module not working, despite being downloaded

I was following along a tutorial where they used the SpeechRecognition module, but when I made it to the first test it returns C:\Users\USER\PycharmProjects\Fatawi\venv\Scripts\python.exe C:/Users/USER/PycharmProjects/Fatawi/main.py Traceback (most recent call last): File "C:\Users\USER\PycharmProjects\Fatawi\main.py", line 1, in <module> import speech_recognition as sr ModuleNotFoundError: No module named 'speech_recognition'我正在按照他们使用 SpeechRecognition 模块的教程进行操作,但是当我进行第一次测试时,它返回C:\Users\USER\PycharmProjects\Fatawi\venv\Scripts\python.exe C:/Users/USER/PycharmProjects/Fatawi/main.py Traceback (most recent call last): File "C:\Users\USER\PycharmProjects\Fatawi\main.py", line 1, in <module> import speech_recognition as sr ModuleNotFoundError: No module named 'speech_recognition'

I've tried reinstalling the library multiple times along with the PyAudio library.我已经尝试多次重新安装该库以及 PyAudio 库。 I ran the test that PyPi has for it and it works, but I don't know how fix it from here.我运行了 PyPi 的测试并且它有效,但我不知道如何从这里修复它。

  1. Check your python interpreter environment (the python version that's run the python file) maybe it's not the same version as python when you downloaded Speech Recognition.检查您的 python 解释器环境(运行 python 文件的 python 版本)可能与您下载语音识别时的 python 版本不同。
  2. Check if you activating the environemt.检查您是否激活了环境。

For better understand see this blog in geeks for geeks might help you.为了更好地理解,请参阅极客中的此博客,因为极客可能会对您有所帮助。

So aftergoing through some of the settings of the project file and checking the Python Interpreter it didn't have the SpeechRecognition Package. So I'm assuming that something went wrong with the install.因此,在完成项目文件的一些设置并检查 Python 解释器后,它没有 SpeechRecognition Package。所以我假设安装出了问题。

Thank you Faisal Faraj for the help.谢谢 Faisal Faraj 的帮助。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM