I tries to convert my .py file to .exe which uses PYTTSX3 module through PyInstaller command and also imported hidden imports like pyttsx3.drivers, pyttsx3.drivers.sapi5.
Command used:
pyinstaller .\SCREENER.PY --hidden-import pyttsx3.drivers.sapi5 --hidden-import babel.numbers --hidden-import pythoncom
SCREENER is the name of my Python File*
But yet I'm getting this Error in my .exe file.
Please suggest me something to handle this, as this is my Final Year project, so I have to get this sorted anyhow.
Any help will be appreciated.
The error may be as a result of spurious imports in your environment. Just had the exact same error.
Tried a few things on the link Thingamabobs added, and others as well.
Ended up making a clean environment, then running pyInstaller via:
pyInstaller --onefile -- paths "D:\Anaconda3\envs<MyEnv>\Lib\site-packages" myScript.py
[, D:\Anaconda3\ and myScript obviously being adjusted to your use]
And the problem was gone.