You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am getting an error for below code. Moreover, this error only happens if I use Pycharm but not in Visual Code, were sapi5 is recognized without problem, any tips? thanks
`Traceback (most recent call last):
File "C:\ProgramData\Anaconda3\lib\site-packages\pyttsx3_init_.py", line 20, in init
eng = _activeEngines[driverName]
File "C:\ProgramData\Anaconda3\lib\weakref.py", line 137, in getitem
o = self.datakey
KeyError: 'sapi5'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\ProgramData\Anaconda3\lib\site-packages\pyttsx3\drivers\sapi5.py", line 3, in
from comtypes.gen import SpeechLib # comtypes
ImportError: cannot import name 'SpeechLib' from 'comtypes.gen' (C:\ProgramData\Anaconda3\lib\site-packages\comtypes\gen_init_.py)
During handling of the above exception, another exception occurred:
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:/Users/david/OneDrive/Escritorio/repository1desk/gpt-2-simple/main_en.py", line 16, in
engine = pyttsx3.init("sapi5")
File "C:\ProgramData\Anaconda3\lib\site-packages\pyttsx3_init_.py", line 22, in init
eng = Engine(driverName, debug)
File "C:\ProgramData\Anaconda3\lib\site-packages\pyttsx3\engine.py", line 30, in init
self.proxy = driver.DriverProxy(weakref.proxy(self), driverName, debug)
File "C:\ProgramData\Anaconda3\lib\site-packages\pyttsx3\driver.py", line 50, in init
self.module = importlib.import_module(name)
File "C:\ProgramData\Anaconda3\lib\importlib_init.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 1006, in _gcd_import
File "", line 983, in _find_and_load
File "", line 967, in _find_and_load_unlocked
File "", line 677, in _load_unlocked
File "", line 728, in exec_module
File "", line 219, in call_with_frames_removed
File "C:\ProgramData\Anaconda3\lib\site-packages\pyttsx3\drivers\sapi5.py", line 6, in
engine = comtypes.client.CreateObject("SAPI.SpVoice")
File "C:\ProgramData\Anaconda3\lib\site-packages\comtypes\client_init.py", line 250, in CreateObject
return manage(obj, clsid, interface=interface)
File "C:\ProgramData\Anaconda3\lib\site-packages\comtypes\client_init.py", line 188, in manage
obj = GetBestInterface(obj)
File "C:\ProgramData\Anaconda3\lib\site-packages\comtypes\client_init.py", line 110, in GetBestInterface
mod = GetModule(tlib)
File "C:\ProgramData\Anaconda3\lib\site-packages\comtypes\client_generate.py", line 110, in GetModule
mod = _CreateWrapper(tlib, pathname)
File "C:\ProgramData\Anaconda3\lib\site-packages\comtypes\client_generate.py", line 184, in _CreateWrapper
mod = _my_import(fullname)
File "C:\ProgramData\Anaconda3\lib\site-packages\comtypes\client_generate.py", line 24, in my_import
return import(fullname, globals(), locals(), ['DUMMY'])
File "C:\ProgramData\Anaconda3\lib\site-packages\comtypes\gen_C866CA3A_32F7_11D2_9602_00C04F8EE628_0_5_4.py", line 73, in
( ['out', 'retval'], POINTER(BSTR), 'ValueName' )),
File "C:\ProgramData\Anaconda3\lib\site-packages\comtypes_init.py", line 329, in setattr
self.make_methods(value)
File "C:\ProgramData\Anaconda3\lib\site-packages\comtypes_init.py", line 698, in make_methods
prototype = WINFUNCTYPE(restype, *argtypes)
File "C:\ProgramData\Anaconda3\lib\ctypes_init.py", line 123, in WINFUNCTYPE
class WinFunctionType(_CFuncPtr):
TypeError: item 2 in argtypes passes a union by value, which is unsupported.
The text was updated successfully, but these errors were encountered:
davisia
changed the title
## I am getting the same error for below code,
TypeError: item 1 in _argtypes_ passes a union by value, which is unsupported.
Apr 11, 2020
I am getting an error for below code. Moreover, this error only happens if I use Pycharm but not in Visual Code, were sapi5 is recognized without problem, any tips? thanks
`import pyttsx3
engine = pyttsx3.init('sapi5')
voices = engine.getProperty('voices')
print(voices)
engine.setProperty('voices', voices[1].id)`
I am using python 3.8.2 in windows 10.
##Error:
`Traceback (most recent call last):
File "C:\ProgramData\Anaconda3\lib\site-packages\pyttsx3_init_.py", line 20, in init
eng = _activeEngines[driverName]
File "C:\ProgramData\Anaconda3\lib\weakref.py", line 137, in getitem
o = self.datakey
KeyError: 'sapi5'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\ProgramData\Anaconda3\lib\site-packages\pyttsx3\drivers\sapi5.py", line 3, in
from comtypes.gen import SpeechLib # comtypes
ImportError: cannot import name 'SpeechLib' from 'comtypes.gen' (C:\ProgramData\Anaconda3\lib\site-packages\comtypes\gen_init_.py)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\ProgramData\Anaconda3\lib\ctypes_init_.py", line 121, in WINFUNCTYPE
return _win_functype_cache[(restype, argtypes, flags)]
KeyError: (<class 'ctypes.HRESULT'>, (<class 'comtypes.BSTR'>, <class 'comtypes.automation.tagVARIANT'>), 0)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:/Users/david/OneDrive/Escritorio/repository1desk/gpt-2-simple/main_en.py", line 16, in
engine = pyttsx3.init("sapi5")
File "C:\ProgramData\Anaconda3\lib\site-packages\pyttsx3_init_.py", line 22, in init
eng = Engine(driverName, debug)
File "C:\ProgramData\Anaconda3\lib\site-packages\pyttsx3\engine.py", line 30, in init
self.proxy = driver.DriverProxy(weakref.proxy(self), driverName, debug)
File "C:\ProgramData\Anaconda3\lib\site-packages\pyttsx3\driver.py", line 50, in init
self.module = importlib.import_module(name)
File "C:\ProgramData\Anaconda3\lib\importlib_init.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 1006, in _gcd_import
File "", line 983, in _find_and_load
File "", line 967, in _find_and_load_unlocked
File "", line 677, in _load_unlocked
File "", line 728, in exec_module
File "", line 219, in call_with_frames_removed
File "C:\ProgramData\Anaconda3\lib\site-packages\pyttsx3\drivers\sapi5.py", line 6, in
engine = comtypes.client.CreateObject("SAPI.SpVoice")
File "C:\ProgramData\Anaconda3\lib\site-packages\comtypes\client_init.py", line 250, in CreateObject
return manage(obj, clsid, interface=interface)
File "C:\ProgramData\Anaconda3\lib\site-packages\comtypes\client_init.py", line 188, in manage
obj = GetBestInterface(obj)
File "C:\ProgramData\Anaconda3\lib\site-packages\comtypes\client_init.py", line 110, in GetBestInterface
mod = GetModule(tlib)
File "C:\ProgramData\Anaconda3\lib\site-packages\comtypes\client_generate.py", line 110, in GetModule
mod = _CreateWrapper(tlib, pathname)
File "C:\ProgramData\Anaconda3\lib\site-packages\comtypes\client_generate.py", line 184, in _CreateWrapper
mod = _my_import(fullname)
File "C:\ProgramData\Anaconda3\lib\site-packages\comtypes\client_generate.py", line 24, in my_import
return import(fullname, globals(), locals(), ['DUMMY'])
File "C:\ProgramData\Anaconda3\lib\site-packages\comtypes\gen_C866CA3A_32F7_11D2_9602_00C04F8EE628_0_5_4.py", line 73, in
( ['out', 'retval'], POINTER(BSTR), 'ValueName' )),
File "C:\ProgramData\Anaconda3\lib\site-packages\comtypes_init.py", line 329, in setattr
self.make_methods(value)
File "C:\ProgramData\Anaconda3\lib\site-packages\comtypes_init.py", line 698, in make_methods
prototype = WINFUNCTYPE(restype, *argtypes)
File "C:\ProgramData\Anaconda3\lib\ctypes_init.py", line 123, in WINFUNCTYPE
class WinFunctionType(_CFuncPtr):
TypeError: item 2 in argtypes passes a union by value, which is unsupported.
Similar to an error by @DebarunMitra, without issue. #6 (comment)
The text was updated successfully, but these errors were encountered: