python-3.x - 语音识别。模块已安装但无法运行

标签 python-3.x speech-recognition

尝试让语音识别模块正常工作。我让它在我的 Windows 10 笔记本电脑、我的 Raspberry pi3 上运行,但我似乎无法让它在 Ubuntu 上运行!该模块已安装,但 PyCharm 或 Thonny 都找不到它。

我已经通过堆栈溢出搜索了解决方案,但没有成功。我尝试卸载并重新安装该模块。我尝试过安装模块的各种版本,例如使用 setup.py 文件或 pip,尝试将文件夹/文件移动到它们应该在的位置等。 (还尝试告诉计算机他是个好 child ,但这也没用......)

我可以使用这行代码

python3 -m speech_recognition

将我的麦克风插入塔中即可工作,但在 PyCharm 或 Thonny 中使用线路时,例如

import speech_recognition
print(speech_recognition.__version__)

我最终得到

Traceback (most recent call last):
  File "/home/elitree/SPRECOG/FU.py", line 1, in <module>
    import speech_recognition
ModuleNotFoundError: No module named 'speech_recognition'

python版本是3.6 pip3版本是19.1.1 Ubuntu版本是Ubuntu 18.04.2 LTS 如果需要,我可以提供其他系统详细信息 我只是不知道现在该怎么办

最佳答案

正如 ForceBru 向我解释的那样 - 我的 IDE 使用了错误的 python 解释器。

首先通过在终端中使用 python3 this_file.py 运行 Python 脚本来识别它

此后,可以通过在终端中使用命令 which python3 识别正确的解释器,然后配置 IDE 以使用该解释器来解决问题。

关于python-3.x - 语音识别。模块已安装但无法运行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56601280/

相关文章:

java - CMUSphinx 真人语音识别太慢?

speech-recognition - 在 Actions on Google 应用上设置语音识别上下文?

python-3.x - Ansible 帮助 : "msg": "The task includes an option with an undefined variable

python-3.x - pygame多线程,程序崩溃

python - 从 scipy.interpolate.InterpolatedUnivariateSpline 中捕获 dfitpack.error

ios - iOS 应用程序的 iPhone 语音识别?

azure - 如何让 Microsoft Azure Speech To Text 在程序运行时开始转录? (统一,C#)

android - 带日期的语音识别

python-3.x - 在稳定的 NumPy 中复制子记录数组

python - 从 pandas 数据框中的多个重复字符串创建列表