marcelotduarte / cx_Freeze

cx_Freeze creates standalone executables from Python scripts, with the same performance, is cross-platform and should work on any platform that Python itself works on.
https://marcelotduarte.github.io/cx_Freeze/
Other
1.37k stars 220 forks source link

NoModuleNamed pyttsx3 #723

Closed Passionate-coder997 closed 4 years ago

Passionate-coder997 commented 4 years ago

I am making a stopwatch in python and to convert my .py file to .exe I had made a setup.py file with this code: import sys from cx_freeze import setup,Executable build_exe_options={"packages":["datetime","os","pyttsx3"] "excludes":"tkinter"} base=None if sys.platform=="win32" base="win32GUI" executables=[Executable("stopwatch.py", icon="icon3.ico", base=base)] setup(name="Stopwatch" options={"build.exe":{"packages":["tkinter"], "include files":["icon3.ico"]}} version="1.0" discription="Something" executables=executables) when I compiled this code it is building the executable but when I run it then it says NoModuleNamed:"pyttsx3" so how I can solve this error

marcelotduarte commented 4 years ago

Maybe

import sys
from cx_freeze import setup,Executable

base=None
if sys.platform=="win32"
    base="win32GUI"
executables=[Executable("stopwatch.py", icon="icon3.ico", base=base)]
setup(name="Stopwatch"
           options={"build_exe":{"packages":["pyttsx3"], "excludes":["tkinter"]}}
            version="1.0"
             discription="Something"
             executables=executables)
marcelotduarte commented 4 years ago

cx_Freeze 6.3 has just been released. Assuming this has been resolved. If you had issues please re-open.