-
Notifications
You must be signed in to change notification settings - Fork 334
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
pyttsx3 fails to execute when compiled #6
Comments
Traceback (most recent call last): During handling of the above exception, another exception occurred: Traceback (most recent call last): Check this #1 |
I think I already tried what was suggested in that thread, but I'll give it another look. |
I'm having the same problem on windows, if anyone has found a solution please let me know |
The No module named 'pyttsx3.drivers' error seems to be an issue with PyInstaller not importing the module loaded with importlib. The old version of pyttsx has a hook file created for use with pyttsx in the Pyinstaller hooks folder. I created a copy for pyttsx3 and added pyttsx3. to drivers, drivers.sapi5, etc. That seems to load the pyttsx3.drivers module fine, but now I am running into a win32com.client error. (This seems to fix the import error and could just be added to your .spec file for your project.)
Again, I just copied the hook-pyttsx.py file in the hooks directory, made a copy named hook-pyttsx3.py in the PyInstaller folder for the hooks and added "pyttsx3." to the hidden imports. There's also a link in the Pyinstaller hook file for work done on this same issue for the older version of pyttsx. pyinstaller and pyttsx The New Error I am now seeing involves the use of the win32com.client package.
Anyone care to take a stab at getting the win32com error fixed? |
Example of what fixes the No module named pyttsx3.drivers error: These are the key lines: This is a .spec file I created that collects all of the pyttsx3 submodules:
Example hook file for pyttsx3 that avoids needing to add any of that into the spec file:
|
Current Error when trying to run pyttsx3 from a Windows 10 64-bit Pyinstaller compiled executible. Traceback (most recent call last): During handling of the above exception, another exception occurred: Traceback (most recent call last): |
Success! |
try python -m 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 --name YourApp yourApp_Location\main.py |
what are hidden imports how to solve the "ModuleNotFoundError: No module named 'pyttsx3.drivers.' " error? |
I am getting the error for below code,`import pyttsx3 engine = pyttsx3.init('sapi5') I am using python 3.8.1 in windows 8.##Error: `Traceback (most recent call last): During handling of the above exception, another exception occurred: Traceback (most recent call last): During handling of the above exception, another exception occurred: Traceback (most recent call last): During handling of the above exception, another exception occurred: Traceback (most recent call last): |
I am using python 3.8`import pyttsx3 engian = pyttsx3.init() I am getting error like this`Traceback (most recent call last): During handling of the above exception, another exception occurred: Traceback (most recent call last): |
try installing "pip install pyttsx3==2.71" this will solve your problem |
try installing "pip install pyttsx3==2.71" |
Thanks! It worked for me |
I am using Python 3.8.2 import pyttsx3 engine = pyttsx3.init('sapi5') def speak(audio): I am being got an error. Traceback (most recent call last): During handling of the above exception, another exception occurred: Traceback (most recent call last): Please solve it |
you are right , i have installed 2.71 and problem is solved , i have tried many times with diff solutions but not work and thats work . so insatll 2.71 v of pyttsx3 |
Error when running Executable created with PyInstaller 3.3 on Windows 10 64-bit and Python v3.6.
[pyttsx3_error.txt](https://github.com/nateshmbhat/pyttsx3/files/1455369/pyttsx3_error.txt)
Example Script:
The text was updated successfully, but these errors were encountered: