简体   繁体   English

为什么在 VSCode 中成功导入模块语音识别时实例化“识别器”时会出现 Python 错误?

[英]Why am I getting a Python error when instantiating a 'Recognizer' while successfully importing module speech_recognition in VSCode?

As I ask in the title, I can't get to the bottom of why I'm getting a 'module has no attribute' error when trying to instantiate a speech_recognition.Recognizer().正如我在标题中所问的那样,当我尝试实例化一个 Speech_recognition.Recognizer() 时,我无法弄清楚为什么我会收到“模块没有属性”错误。 What's throwing me is that it is suggested by intellisense, but errors when I run it:让我失望的是它是由智能感知建议的,但在我运行时出现错误:

vscode intellisense screenshot vscode智能感知截图

This is a new one for me... any help would be greatly appreciated.这对我来说是一个新的......任何帮助将不胜感激。

As I ask in the title, I can't get to the bottom of why I'm getting a 'module has no attribute' error when trying to instantiate a speech_recognition.Recognizer().正如我在标题中所问的那样,当我尝试实例化一个 Speech_recognition.Recognizer() 时,我无法弄清楚为什么我会收到“模块没有属性”错误。 What's throwing me is that it is suggested by intellisense, but errors when I run it:让我失望的是它是由智能感知建议的,但在我运行时出现错误:

vscode intellisense screenshot vscode智能感知截图

This is a new one for me... any help would be greatly appreciated.这对我来说是一个新的......任何帮助将不胜感激。

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

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