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

coqui_ai_tts TypeError TTS.list_models() in Ubuntu22.04 #18

Open
dearfad opened this issue Dec 19, 2023 · 3 comments
Open

coqui_ai_tts TypeError TTS.list_models() in Ubuntu22.04 #18

dearfad opened this issue Dec 19, 2023 · 3 comments

Comments

@dearfad
Copy link

dearfad commented Dec 19, 2023

import pyttsx4
engine = pyttsx4.init('coqui_ai_tts')
engine.say('this is an english text to voice test, listen it carefully and tell who i am.')
engine.runAndWait()

Traceback (most recent call last):
File "/home/dearfad/miniconda3/envs/breastvsp/lib/python3.10/site-packages/pyttsx4/init.py", line 20, in init
eng = _activeEngines[driverName]
File "/home/dearfad/miniconda3/envs/breastvsp/lib/python3.10/weakref.py", line 137, in getitem
o = self.datakey
KeyError: 'coqui_ai_tts'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/dearfad/Repositories/breastvsp/libs/tts/coqui.py", line 3, in
engine = pyttsx4.init('coqui_ai_tts')
File "/home/dearfad/miniconda3/envs/breastvsp/lib/python3.10/site-packages/pyttsx4/init.py", line 22, in init
eng = Engine(driverName, debug)
File "/home/dearfad/miniconda3/envs/breastvsp/lib/python3.10/site-packages/pyttsx4/engine.py", line 30, in init
self.proxy = driver.DriverProxy(weakref.proxy(self), driverName, debug)
File "/home/dearfad/miniconda3/envs/breastvsp/lib/python3.10/site-packages/pyttsx4/driver.py", line 52, in init
self._driver = self._module.buildDriver(weakref.proxy(self))
File "/home/dearfad/miniconda3/envs/breastvsp/lib/python3.10/site-packages/pyttsx4/drivers/coqui_ai_tts.py", line 15, in buildDriver
return TTSDriver(proxy)
File "/home/dearfad/miniconda3/envs/breastvsp/lib/python3.10/site-packages/pyttsx4/drivers/coqui_ai_tts.py", line 21, in init
self.model_name = TTS(TTS.list_models()[0])
TypeError: TTS.list_models() missing 1 required positional argument: 'self'

How to solve it...

@nainglinwai1
Copy link

I have the same issue too. Have you got the solution?

@yecllsl
Copy link

yecllsl commented Apr 25, 2024

I have the same issue too. windows 11,python 3.11
发生异常: TypeError
TTS.list_models() missing 1 required positional argument: 'self'
KeyError: 'coqui_ai_tts'

During handling of the above exception, another exception occurred:

......, line 13, in
engine = pyttsx4.init('coqui_ai_tts')
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: TTS.list_models() missing 1 required positional argument: 'self'

@Battant
Copy link

Battant commented Jul 15, 2024

Hello,

I have Same problem on Mac OS and windows

Example on windows 11 and python.12.4

Code :
`

import pyttsx4

engine4 = pyttsx4.init('coqui_ai_tts')

`
Actual result :
Traceback (most recent call last):
File "C:\Users\username\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0\LocalCache\local-packages\Python312\site-packages\pyttsx4_init_.py", line 20, in init
eng = _activeEngines[driverName]
~~~~~~~~~~~~~~^^^^^^^^^^^^
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.12_3.12.1264.0_x64__qbz5n2kfra8p0\Lib\weakref.py", line 136, in getitem
o = self.datakey
~~~~~~~~~^^^^^
KeyError: 'coqui_ai_tts'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\Users\username\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0\LocalCache\local-packages\Python312\site-packages\pyttsx4\drivers\coqui_ai_tts.py", line 7, in
from TTS.api import TTS
ModuleNotFoundError: No module named 'TTS'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\Users\username\src\program\test_tts_native.py", line 5, in
engine4 = pyttsx4.init('coqui_ai_tts')
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\username\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0\LocalCache\local-packages\Python312\site-packages\pyttsx4_init_.py", line 22, in init
eng = Engine(driverName, debug)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\username\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0\LocalCache\local-packages\Python312\site-packages\pyttsx4\engine.py", line 30, in init
self.proxy = driver.DriverProxy(weakref.proxy(self), driverName, debug)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\username\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0\LocalCache\local-packages\Python312\site-packages\pyttsx4\driver.py", line 50, in init
self.module = importlib.import_module(name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.12_3.12.1264.0_x64__qbz5n2kfra8p0\Lib\importlib_init
.py", line 90, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "", line 1387, in _gcd_import
File "", line 1360, in _find_and_load
File "", line 1331, in _find_and_load_unlocked
File "", line 935, in _load_unlocked
File "", line 995, in exec_module
File "", line 488, in _call_with_frames_removed
File "C:\Users\username\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0\LocalCache\local-packages\Python312\site-packages\pyttsx4\drivers\coqui_ai_tts.py", line 12, in
from TTS.api import TTS
ModuleNotFoundError: No module named 'TTS'
`
engine4.say('this is an english text to voice test.')

Expand result 😀
Initial successful 😀
Could you help me please to fix this issus

Best regards

Battant

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

4 participants