text=takeCommand() ^^^^" /> text=takeCommand() ^^^^" /> text=takeCommand() ^^^^"/>

ModuleNotFoundError: No module named 'distutils' how to solve this in MacOS

209 Views Asked by At

Was trying to make python use speech recognition

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'

got this error though.

i was seeing a video from Code With Harry and tried making Jarvis with it but got stuck in this part where its not able to recognize my speech

1

There are 1 best solutions below

0
Aarush On

You can run the following code:

pip install setuptools