Briefly: I created the main.py file and installed pyttsx3 through pip. Compiled in Exe, and after compiling into exe, a stack of errors crashes:

Traceback (most recent call last): File "main.py", line 2, in <module> File "lib\site-packages\pyttsx3\__init__.py", line 46, in init File "lib\site-packages\pyttsx3\engine.py", line 52, in __init__ File "lib\site-packages\pyttsx3\driver.py", line 75, in __init__ File "importlib\__init__.py", line 126, in import_module File "<frozen importlib._bootstrap>", line 978, in _gcd_import File "<frozen importlib._bootstrap>", line 961, in _find_and_load File "<frozen importlib._bootstrap>", line 936, in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line 205, in _call_with_frames_removed File "<frozen importlib._bootstrap>", line 978, in _gcd_import File "<frozen importlib._bootstrap>", line 961, in _find_and_load File "<frozen importlib._bootstrap>", line 948, in _find_and_load_unlocked ModuleNotFoundError: No module named 'pyttsx3.drivers' [3408] Failed to execute script main 

Who knows - help pliz. Very necessary.

  • Perhaps that pyttsx3 module was not picked up and added to exe, in such cases modules are manually specified. Specify in the question tag what you collected in exe - gil9red
  • the pyinstaller module - Artyom Galiaskarov

1 answer 1

I also ran into this problem. And found a solution! Enter this code and file name.

 **pyinstaller --hidden-import=pyttsx3.drivers --hidden-import=pyttsx3.drivers.dummy --hidden-import=pyttsx3.drivers.espeak --hidden-import=pyttsx3.drivers.nsss --hidden-import=pyttsx3.drivers.sapi5 Имяфайла.py** 
New member
Kopick Pythonick is a new member of the site. Be lenient in asking clarifying questions, commenting and answering. Read about the norms of behavior .