nateshmbhat / pyttsx3

Offline Text To Speech synthesis for python
Mozilla Public License 2.0
1.99k stars 321 forks source link

Not working anymore on 3.12.3 #313

Closed LincolnKermit closed 1 month ago

LincolnKermit commented 1 month ago

Version of python : 3.12.3

OS : OS X, Based on unix.

`slk@nine CustomPi-LLM % /usr/local/bin/python3 /Users/slk/Documents/Workspace/CustomPi-LLM/core.py Initalising TTSCore... Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/pyttsx3/init.py", line 20, in init eng = _activeEngines[driverName]


  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/weakref.py", line 136, in __getitem__
    o = self.data[key]()
        ~~~~~~~~~^^^^^
KeyError: None

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/slk/Documents/Workspace/CustomPi-LLM/core.py", line 8, in <module>
    engine = pyttsx3.init()
             ^^^^^^^^^^^^^^
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/pyttsx3/__init__.py", line 22, in init
    eng = Engine(driverName, debug)
          ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/pyttsx3/engine.py", line 30, in __init__
    self.proxy = driver.DriverProxy(weakref.proxy(self), driverName, debug)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/pyttsx3/driver.py", line 50, in __init__
    self._module = importlib.import_module(name)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/importlib/__init__.py", line 90, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1387, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1360, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1331, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 935, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 995, in exec_module
  File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/pyttsx3/drivers/nsss.py", line 12, in <module>
    class NSSpeechDriver(NSObject):
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/pyttsx3/drivers/nsss.py", line 13, in NSSpeechDriver
    @objc.python_method
     ^^^^
NameError: name 'objc' is not defined. Did you mean: 'object'?`
willwade commented 1 month ago

Yep try https://github.com/thevickypedia/py3-tts