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

Not working on 3.11.5 #314

Closed
marciprescott opened this issue May 18, 2024 · 2 comments
Closed

Not working on 3.11.5 #314

marciprescott opened this issue May 18, 2024 · 2 comments

Comments

@marciprescott
Copy link

Traceback (most recent call last):
File "/Users/scripts/env/lib/python3.11/site-packages/pyttsx3/init.py", line 20, in init
eng = _activeEngines[driverName]
~~~~~~~~~~~~~~^^^^^^^^^^^^
File "/Users/marciprescott/anaconda3/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/scripts/main.py", line 6, in
speaker = pyttsx3.init()
^^^^^^^^^^^^^^
File "/Users/scripts/env/lib/python3.11/site-packages/pyttsx3/init.py", line 22, in init
eng = Engine(driverName, debug)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/scripts/env/lib/python3.11/site-packages/pyttsx3/engine.py", line 30, in init
self.proxy = driver.DriverProxy(weakref.proxy(self), driverName, debug)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/scripts/env/lib/python3.11/site-packages/pyttsx3/driver.py", line 50, in init
self._module = importlib.import_module(name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/marciprescott/anaconda3/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/scripts/env/lib/python3.11/site-packages/pyttsx3/drivers/nsss.py", line 12, in
class NSSpeechDriver(NSObject):
File "/Users/scripts/env/lib/python3.11/site-packages/pyttsx3/drivers/nsss.py", line 13, in NSSpeechDriver
@objc.python_method
^^^^
NameError: name "objc" is not defined. Did you mean: "object"?

@willwade
Copy link
Collaborator

Try https://github.com/thevickypedia/py3-tts

@nateshmbhat
Copy link
Owner

updated readme with :

For Mac, If you face error related to "objc" when running the init() method :
Install 9.0.1 version of pyobjc : "pip install pyobjc==9.0.1"

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

3 participants