smallest-cock / RL-Custom-Quickchat

Enables custom quick chats (and more) in Rocket League using keypress automation
4 stars 0 forks source link

Can't run script cause distutils not found #2

Closed thebear45800 closed 10 months ago

thebear45800 commented 10 months ago

Hello,

I'm trying to run any script but every scripts failed with error no module named distUtils.

Full stack error :

pygame 2.5.2 (SDL 2.28.3, Python 3.12.1)
Hello from the pygame community. https://www.pygame.org/contribute.html

~~~~~~ DualSense Wireless Controller detected ~~~~~~

waiting for quickchat inputs....

Traceback (most recent call last):
  File "C:\Users\thebe\Downloads\RL-Custom-Quickchat-main\PS5_controller_example.py", line 347, in <module>
    mic = sr.Microphone()
          ^^^^^^^^^^^^^^^
  File "C:\Users\thebe\AppData\Local\Programs\Python\Python312\Lib\site-packages\speech_recognition\__init__.py", line 80, in __init__
    self.pyaudio_module = self.get_pyaudio()
                          ^^^^^^^^^^^^^^^^^^
  File "C:\Users\thebe\AppData\Local\Programs\Python\Python312\Lib\site-packages\speech_recognition\__init__.py", line 111, in get_pyaudio
    from distutils.version import LooseVersion
ModuleNotFoundError: No module named 'distutils'

I tried to install distUtils with this command :

pip install distutils

But failed with :

ERROR: Could not find a version that satisfies the requirement distutils (from versions: none) ERROR: No matching distribution found for distutils

By searchong on internet, distutils seems to be deleted since Python 3.12

What can I do ?

smallest-cock commented 10 months ago

@thebear45800 Thanks for bringing it to my attention. I've never encountered this error because I was still using python 3.10 on my system.

Apparently the distutils module has been removed in python 3.12 (and has been deprecated since 3.10): https://peps.python.org/pep-0632/

It's suggested that people use the setuptools module instead, which contains a complete copy of distutils inside it. So doing a pip install setuptools should fix the error. I'll also make sure to update the README.md to include that module in the install steps.