thevickypedia / py3-tts

Offline Text To Speech library for python
https://py3-tts.vigneshrao.com/
Mozilla Public License 2.0
30 stars 2 forks source link

Error on 3.12.2 #3

Open elefantfod opened 6 months ago

elefantfod commented 6 months ago

Traceback (most recent call last): File "/home/ubuntu/.local/lib/python3.12/site-packages/pyttsx3/init.py", line 24, in init eng = _activeEngines[driverName]


  File "/usr/local/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 "/home/ubuntu/.local/lib/python3.12/site-packages/pyttsx3/__init__.py", line 27, in init
    eng = Engine(driverName=driverName, debug=debug)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ubuntu/.local/lib/python3.12/site-packages/pyttsx3/engine.py", line 32, in __init__
    self.proxy = driver.DriverProxy(weakref.proxy(self), driverName, debug)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ubuntu/.local/lib/python3.12/site-packages/pyttsx3/driver.py", line 51, in __init__
    self._module = importlib.import_module(name)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/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 "/home/ubuntu/.local/lib/python3.12/site-packages/pyttsx3/drivers/espeak.py", line 8, in <module>
    from . import _espeak, fromUtf8, toUtf8
  File "/home/ubuntu/.local/lib/python3.12/site-packages/pyttsx3/drivers/_espeak.py", line 129, in <module>
    Initialize = cfunc('espeak_Initialize', dll, c_int,
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ubuntu/.local/lib/python3.12/site-packages/pyttsx3/drivers/_espeak.py", line 16, in cfunc
    return CFUNCTYPE(result, *atypes)((name, dll), tuple(aflags))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute '_handle'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/workspaces/169528778/lecture 9 - et cetera/test_tts.py", line 3, in <module>
    engine = pyttsx3.init()
             ^^^^^^^^^^^^^^
  File "/home/ubuntu/.local/lib/python3.12/site-packages/pyttsx3/__init__.py", line 31, in init
    raise RuntimeError("\n\nUnable to load driver '%s'" % driverName)
RuntimeError: 

Unable to load driver 'None'
willwade commented 5 months ago

What was your code to run this?I think this is fixed in my PR https://github.com/thevickypedia/py3-tts/pull/6

I note you are on linux - I could do with someone testing this :)

DGrothe-PhD commented 4 months ago

Would like to test this, only trouble is, I don't have linux.

I tried to install Linux on my old laptop but the stick is not recognized and I cannot change anything in BIOS as the arrow keys are broken.

Any option to test this through some docker container setup?

willwade commented 4 months ago

@DGrothe-PhD - https://github.com/thevickypedia/py3-tts/pull/6#issuecomment-2252920647