试图让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,但卡在了这部分,它无法识别我的演讲
您可以运行以下代码:
pip 安装设置工具