Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- To reproduce:
- <ol>
- <li>Download the gist</li>
- <li>Install the pyttsx3 Python library</li>
- <li>
- Run the code normally.
- <pre><code>>python tts_test.py
- It works</code></pre>
- </li>
- <li>
- Build with PyInstaller:
- <pre><code>>python -m pyinstaller tts.spec
- Build exits without warnings or errors</code></pre>
- </li>
- <li>
- Run the executable:
- <pre><code>>dist\main\TTS_Test.exe
- [13544] PyInstaller Bootloader 3.x
- [13544] LOADER: executable is C:\Users\Alexandre\Desktop\tts_test\dist\main\TTS_Test.exe
- [13544] LOADER: homepath is C:\Users\Alexandre\Desktop\tts_test\dist\main
- [13544] LOADER: _MEIPASS2 is NULL
- [13544] LOADER: archivename is C:\Users\Alexandre\Desktop\tts_test\dist\main\TTS_Test.exe
- [13544] LOADER: No need to extract files to run; setting extractionpath to homepath
- [13544] LOADER: SetDllDirectory(C:\Users\Alexandre\Desktop\tts_test\dist\main)
- [13544] LOADER: Already in the child - running user's code.
- [13544] LOADER: Python library: C:\Users\Alexandre\Desktop\tts_test\dist\main\python27.dll
- [13544] LOADER: Loaded functions from Python library.
- [13544] LOADER: Manipulating environment (sys.path, sys.prefix)
- [13544] LOADER: sys.prefix is C:\Users\ALEXAN~1\Desktop\tts_test\dist\main
- [13544] LOADER: Setting runtime options
- [13544] LOADER: Initializing python
- [13544] LOADER: Overriding Python's sys.path
- [13544] LOADER: Post-init sys.path is C:\Users\Alexandre\Desktop\tts_test\dist\main
- [13544] LOADER: Setting sys.argv
- [13544] LOADER: setting sys._MEIPASS
- [13544] LOADER: importing modules from CArchive
- [13544] LOADER: extracted struct
- [13544] LOADER: callfunction returned...
- [13544] LOADER: extracted pyimod01_os_path
- [13544] LOADER: callfunction returned...
- [13544] LOADER: extracted pyimod02_archive
- [13544] LOADER: callfunction returned...
- [13544] LOADER: extracted pyimod03_importers
- [13544] LOADER: callfunction returned...
- [13544] LOADER: Installing PYZ archive with Python modules.
- [13544] LOADER: PYZ archive: out00-PYZ.pyz
- [13544] LOADER: Running pyiboot01_bootstrap.py
- [13544] LOADER: Running pyi_rth_win32comgenpy.py
- [13544] LOADER: Running tts_test.py
- Traceback (most recent call last):
- File "C:\Users\Alexandre\Desktop\tts_test\tts_test.py", line 3, in <module>
- engine = pyttsx3.init()
- File "C:\Python27\lib\site-packages\pyttsx3\__init__.py", line 46, in init
- eng = Engine(driverName, debug)
- File "C:\Python27\lib\site-packages\pyttsx3\engine.py", line 52, in __init__
- self.proxy = driver.DriverProxy(weakref.proxy(self), driverName, debug)
- File "C:\Python27\lib\site-packages\pyttsx3\driver.py", line 77, in __init__
- self._driver = self._module.buildDriver(weakref.proxy(self))
- File "C:\Python27\lib\site-packages\pyttsx3\drivers\sapi5.py", line 22, in buildDriver
- return SAPI5Driver(proxy)
- File "C:\Python27\lib\site-packages\pyttsx3\drivers\sapi5.py", line 31, in __init__
- SAPI5DriverEventSink)
- File "C:\Python27\lib\site-packages\win32com\client\__init__.py", line 317, in WithEvents
- gencache.EnsureModule(tla[0], tla[1], tla[3], tla[4], bValidateFile=0)
- File "C:\Python27\lib\site-packages\win32com\client\gencache.py", line 524, in EnsureModule
- module = MakeModuleForTypelib(typelibCLSID, lcid, major, minor, progressInstance, bForDemand = bForDemand, bBuildHidden = bBuildHidden)
- File "C:\Python27\lib\site-packages\win32com\client\gencache.py", line 291, in MakeModuleForTypelib
- makepy.GenerateFromTypeLibSpec( (typelibCLSID, lcid, major, minor), progressInstance=progressInstance, bForDemand = bForDemand, bBuildHidden = bBuildHidden)
- File "C:\Python27\lib\site-packages\win32com\client\makepy.py", line 286, in GenerateFromTypeLibSpec
- gencache.AddModuleToCache(info.clsid, info.lcid, info.major, info.minor)
- File "C:\Python27\lib\site-packages\win32com\client\gencache.py", line 554, in AddModuleToCache
- mod = _GetModule(fname)
- File "C:\Python27\lib\site-packages\win32com\client\gencache.py", line 633, in _GetModule
- mod = __import__(mod_name)
- File "c:\users\alexan~1\appdata\local\temp\tmpcpltk4\gen_py\C866CA3A-32F7-11D2-9602-00C04F8EE628x0x5x4.py", line 10, in <module>
- import win32com.client.CLSIDToClass, pythoncom, pywintypes
- File "c:\python27\Lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 161, in load_module
- return self._importer.load_module(fullname, self._entry_name)
- File "c:\python27\Lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 396, in load_module
- exec(bytecode, module.__dict__)
- File "C:\Python27\lib\site-packages\pythoncom.py", line 2, in <module>
- import pywintypes
- File "c:\python27\Lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 161, in load_module
- return self._importer.load_module(fullname, self._entry_name)
- File "c:\python27\Lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 396, in load_module
- exec(bytecode, module.__dict__)
- File "C:\Python27\lib\site-packages\win32\lib\pywintypes.py", line 2, in <module>
- import imp, sys, os
- File "c:\python27\Lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 161, in load_module
- return self._importer.load_module(fullname, self._entry_name)
- File "c:\python27\Lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 396, in load_module
- exec(bytecode, module.__dict__)
- File "C:\Python27\lib\os.py", line 120, in <module>
- from os.path import (curdir, pardir, sep, pathsep, defpath, extsep, altsep,
- ImportError: No module named path
- [13544] Failed to execute script tts_test
- [13544] LOADER: OK.
- [13544] LOADER: Cleaning up Python interpreter.</code></pre>
- </li>
- </ol>
Add Comment
Please, Sign In to add comment