Problème de pyttsx3.init()

Le problème exposé dans ce sujet a été résolu.

le module pytts3 a fonctionné corrrectement avec les petits exercices que j’ai exécuté. Mais depuis hier soir, les mêmes scripts qui marchaient bien se bloque, et pyttsx3.init() retourne le message suivant

Python 3.7.3 (v3.7.3:ef4ec6ed12, Mar 25 2019, 21:26:53) [MSC v.1916 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license()" for more information.

import pyttsx3 pyttsx3.init() Traceback (most recent call last): File "C:\Program Files\Python37–32\lib\site-packages\pyttsx3__init.py", line 20, in init eng = _activeEngines[driverName] File "C:\Program Files\Python37–32\lib\weakref.py", line 137, in getitem__ o = self.datakey KeyError: None

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "<pyshell#1>", line 1, in <module> pyttsx3.init() File "C:\Program Files\Python37–32\lib\site-packages\pyttsx3__init.py", line 22, in init eng = Engine(driverName, debug) File "C:\Program Files\Python37–32\lib\site-packages\pyttsx3\engine.py", line 30, in init self.proxy = driver.DriverProxy(weakref.proxy(self), driverName, debug) File "C:\Program Files\Python37–32\lib\site-packages\pyttsx3\driver.py", line 50, in init self._module = importlib.import_module(name) File "C:\Program Files\Python37–32\lib\importlib__init.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "<frozen importlib._bootstrap>", line 1006, in _gcd_import File "<frozen importlib._bootstrap>", line 983, in _find_and_load File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line 677, in _load_unlocked File "<frozen importlib._bootstrap_external>", line 728, in exec_module File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed File "C:\Program Files\Python37–32\lib\site-packages\pyttsx3\drivers\sapi5.py", line 3, in <module> import win32com.client File "C:\Program Files\Python37–32\lib\site-packages\win32com\client__init.py", line 11, in <module> from . import gencache File "C:\Program Files\Python37–32\lib\site-packages\win32com\client\gencache.py", line 660, in <module> init() File "C:\Program Files\Python37–32\lib\site-packages\win32com\client\gencache.py", line 60, in init__ _LoadDicts() File "C:\Program Files\Python37–32\lib\site-packages\win32com\client\gencache.py", line 113, in _LoadDicts version = p.load() _pickle.UnpicklingError: invalid load key, '\x00’.

Il s’agit du langage de programmation python 3.7.3 Que faire?

+0 -0

ok

Ce n’est rien de compliquer, il s’agit d’un petit script inspiré de la documentation que voici:

import pyttsx3

engine = pyttsx3.init() engine.setProperty(’rate’, 150) # Speed percent (can go over 100) engine.setProperty(’volume’, 0.9) # Volume 0–1<

engine.say("On va réciter l’angelus!") engine.say("L’ange du Seigneur apporta l’annonce à Marie") engine.say("Et elle conçut du Saint-Esprit.") engine.say("Je vous salue Marie, pleine de grâce,") engine.say("Le Seigneur est avec vous,") engine.say("Vous êtes bénie entre toutes les femmes,") engine.say("Et Jésus, le fruit de vos entrailles, est béni.") engine.say("Sainte Marie, mère de Dieu,") engine.say("Priez pour nous, pauvres pécheurs,") engine.say("Maintenant, et à l’heure de notre mort.") engine.say("Amen") engine.runAndWait()

Au lancement, j’ai le message suivant (je signal que ç’a déjà fonctionné):

Traceback (most recent call last): File "C:\Program Files\Python37–32\lib\site-packages\pyttsx3__init.py", line 20, in init eng = _activeEngines[driverName] File "C:\Program Files\Python37–32\lib\weakref.py", line 137, in getitem__ o = self.datakey KeyError: None

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "E:\Dvpt\Python\Exercices\tkinter\module111.py", line 5, in <module> engine = pyttsx3.init() File "C:\Program Files\Python37–32\lib\site-packages\pyttsx3__init.py", line 22, in init eng = Engine(driverName, debug) File "C:\Program Files\Python37–32\lib\site-packages\pyttsx3\engine.py", line 30, in init self.proxy = driver.DriverProxy(weakref.proxy(self), driverName, debug) File "C:\Program Files\Python37–32\lib\site-packages\pyttsx3\driver.py", line 50, in init self._module = importlib.import_module(name) File "C:\Program Files\Python37–32\lib\importlib__init.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "<frozen importlib._bootstrap>", line 1006, in _gcd_import File "<frozen importlib._bootstrap>", line 983, in _find_and_load File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line 677, in _load_unlocked File "<frozen importlib._bootstrap_external>", line 728, in exec_module File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed File "C:\Program Files\Python37–32\lib\site-packages\pyttsx3\drivers\sapi5.py", line 3, in <module> import win32com.client File "C:\Program Files\Python37–32\lib\site-packages\win32com\client__init.py", line 11, in <module> from . import gencache File "C:\Program Files\Python37–32\lib\site-packages\win32com\client\gencache.py", line 660, in <module> init() File "C:\Program Files\Python37–32\lib\site-packages\win32com\client\gencache.py", line 60, in init__ _LoadDicts() File "C:\Program Files\Python37–32\lib\site-packages\win32com\client\gencache.py", line 113, in _LoadDicts version = p.load() _pickle.UnpicklingError: invalid load key, '\x00’.

Connectez-vous pour pouvoir poster un message.
Connexion

Pas encore membre ?

Créez un compte en une minute pour profiter pleinement de toutes les fonctionnalités de Zeste de Savoir. Ici, tout est gratuit et sans publicité.
Créer un compte