ModuleNotFoundError:没有名为“distutils”的模块如何在 MacOS 中解决此问题

问题描述 投票:0回答:1

试图让Python使用语音识别

File "/Users/hridayjain/PycharmProjects/Jarvis/main.py", line 18, in <module>
    text=takeCommand()
         ^^^^^^^^^^^^^
  File "/Users/hridayjain/PycharmProjects/Jarvis/main.py", line 8, in takeCommand
    with sr.Microphone() as source:
         ^^^^^^^^^^^^^^^
  File "/Users/hridayjain/PycharmProjects/Jarvis/.venv/lib/python3.12/site-packages/speech_recognition/__init__.py", line 80, in __init__
    self.pyaudio_module = self.get_pyaudio()
                          ^^^^^^^^^^^^^^^^^^
  File "/Users/hridayjain/PycharmProjects/Jarvis/.venv/lib/python3.12/site-packages/speech_recognition/__init__.py", line 111, in get_pyaudio
    from distutils.version import LooseVersion
ModuleNotFoundError: No module named 'distutils'

但是遇到了这个错误。

我正在观看 Code With Harry 的视频,并尝试用它制作 Jarvis,但卡在了这部分,它无法识别我的演讲

python module speech-recognition pyaudio microphone
1个回答
0
投票

您可以运行以下代码:

pip 安装设置工具

© www.soinside.com 2019 - 2024. All rights reserved.