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

engine = pyttsx3.init('sapi5') #1

Open
whitehatboy005 opened this issue Jul 10, 2024 · 1 comment
Open

engine = pyttsx3.init('sapi5') #1

whitehatboy005 opened this issue Jul 10, 2024 · 1 comment

Comments

@whitehatboy005
Copy link
Owner

whitehatboy005 commented Jul 10, 2024

if you face this type of problem like

Traceback (most recent call last):
File "C:\Users\Haris\AppData\Local\Programs\Python\Python311\Lib\site-packages\pyttsx3_init_.py", line 20, in init
eng = _activeEngines[driverName]
~~~~~~~~~~~~~~^^^^^^^^^^^^
File "C:\Users\Haris\AppData\Local\Programs\Python\Python311\Lib\weakref.py", line 136, in getitem
o = self.datakey
~~~~~~~~~^^^^^
KeyError: 'sapi5'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\Users\Haris\Python-Projects\Jarvis\Jarvis\jarvis.py", line 38, in
engine = pyttsx3.init('sapi5')
^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Haris\AppData\Local\Programs\Python\Python311\Lib\site-packages\pyttsx3_init_.py", line 22, in init
eng = Engine(driverName, debug)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Haris\AppData\Local\Programs\Python\Python311\Lib\site-packages\pyttsx3\engine.py", line 30, in init
self.proxy = driver.DriverProxy(weakref.proxy(self), driverName, debug)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Haris\AppData\Local\Programs\Python\Python311\Lib\site-packages\pyttsx3\driver.py", line 50, in init
self.module = importlib.import_module(name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Haris\AppData\Local\Programs\Python\Python311\Lib\importlib_init
.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "", line 1206, in _gcd_import
File "", line 1178, in _find_and_load
File "", line 1149, 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 "C:\Users\Haris\AppData\Local\Programs\Python\Python311\Lib\site-packages\pyttsx3\drivers\sapi5.py", line 1, in
import comtypes.client # Importing comtypes.client will make the gen subpackage
^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Haris\AppData\Local\Programs\Python\Python311\Lib\site-packages\comtypes_init
.py", line 375
except COMError, err:
^^^^^^^^^^^^^
SyntaxError: multiple exception types must be parenthesized

@whitehatboy005
Copy link
Owner Author

if you face this type of problem like Traceback (most recent call last): File "C:\Users\Haris\AppData\Local\Programs\Python\Python311\Lib\site-packages\pyttsx3__init__.py", line 20, in init eng = _activeEngines[driverName] ~~~~~~~~~~~~~~^^^^^^^^^^^^ File "C:\Users\Haris\AppData\Local\Programs\Python\Python311\Lib\weakref.py", line 136, in getitem o = self.datakey ~~~~~~~~~^^^^^ KeyError: 'sapi5'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "C:\Users\Haris\Python-Projects\Jarvis\Jarvis\jarvis.py", line 38, in engine = pyttsx3.init('sapi5') ^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Haris\AppData\Local\Programs\Python\Python311\Lib\site-packages\pyttsx3__init__.py", line 22, in init eng = Engine(driverName, debug) ^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Haris\AppData\Local\Programs\Python\Python311\Lib\site-packages\pyttsx3\engine.py", line 30, in init self.proxy = driver.DriverProxy(weakref.proxy(self), driverName, debug) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Haris\AppData\Local\Programs\Python\Python311\Lib\site-packages\pyttsx3\driver.py", line 50, in init self.module = importlib.import_module(name) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Haris\AppData\Local\Programs\Python\Python311\Lib\importlib__init_.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "", line 1206, in _gcd_import File "", line 1178, in _find_and_load File "", line 1149, 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 "C:\Users\Haris\AppData\Local\Programs\Python\Python311\Lib\site-packages\pyttsx3\drivers\sapi5.py", line 1, in import comtypes.client # Importing comtypes.client will make the gen subpackage ^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Haris\AppData\Local\Programs\Python\Python311\Lib\site-packages\comtypes__init.py", line 375 except COMError, err: ^^^^^^^^^^^^^ SyntaxError: multiple exception types must be parenthesized

pip install --upgrade comtypes
pip uninstall pyttsx3
pip install pyttsx3

@whitehatboy005 whitehatboy005 changed the title package repair engine = pyttsx3.init('sapi5') Jul 10, 2024
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

1 participant