Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pyttsx3 not working with python 3.11 #304

Closed
SaiAnirudh659 opened this issue Feb 28, 2024 · 2 comments
Closed

pyttsx3 not working with python 3.11 #304

SaiAnirudh659 opened this issue Feb 28, 2024 · 2 comments

Comments

@SaiAnirudh659
Copy link

I have a problem with pyttsx3 working with python 3.11

Traceback (most recent call last):
File "/Users/anirudh/Desktop/pythonProject4/.venv/lib/python3.11/site-packages/pyttsx3/init.py", line 20, in init
eng = _activeEngines[driverName]
~~~~~~~~~~~~~~^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/weakref.py", line 136, in getitem
o = self.datakey
~~~~~~~~~^^^^^
KeyError: None

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/Users/anirudh/Desktop/pythonProject4/text to speech.py", line 5, in
text_speech = pyttsx3.init()
^^^^^^^^^^^^^^
File "/Users/anirudh/Desktop/pythonProject4/.venv/lib/python3.11/site-packages/pyttsx3/init.py", line 22, in init
eng = Engine(driverName, debug)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/anirudh/Desktop/pythonProject4/.venv/lib/python3.11/site-packages/pyttsx3/engine.py", line 30, in init
self.proxy = driver.DriverProxy(weakref.proxy(self), driverName, debug)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/anirudh/Desktop/pythonProject4/.venv/lib/python3.11/site-packages/pyttsx3/driver.py", line 50, in init
self._module = importlib.import_module(name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/importlib/init.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "", line 1204, in _gcd_import
File "", line 1176, in _find_and_load
File "", line 1147, in _find_and_load_unlocked
File "", line 690, in _load_unlocked
File "", line 940, in exec_module
File "", line 241, in _call_with_frames_removed
File "/Users/anirudh/Desktop/pythonProject4/.venv/lib/python3.11/site-packages/pyttsx3/drivers/nsss.py", line 12, in
class NSSpeechDriver(NSObject):
File "/Users/anirudh/Desktop/pythonProject4/.venv/lib/python3.11/site-packages/pyttsx3/drivers/nsss.py", line 13, in NSSpeechDriver
@object.python_method
^^^^^^^^^^^^^^^^^^^^
AttributeError: type object "object" has no attribute "python_method"

@willwade
Copy link
Collaborator

willwade commented May 3, 2024

This fork fixes this https://github.com/thevickypedia/py3-tts

@willwade
Copy link
Collaborator

Im pretty sure @nateshmbhat you can close this now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants