RapidWareTech / pyttsx

Cross-platform text-to-speech wrapper
Other
370 stars 134 forks source link

Error "return -1" while using pyinstaller on a code which imports pyttsx #38

Open a4abhishek opened 8 years ago

a4abhishek commented 8 years ago

I have created a small project Which uses pyttsx. I want to distribute my code with no dependencies. So I used pyinstaller to create windows exe file. It has succesfully created a bundled exe file, but when I tried to execute that file it thrown error. I have googled for almost 6 hours but I didn't find any solution to my problem.

When I removed the lines which uses pyttsx the executable worked fine.

Here's the full description of Building and Running the file:

Build Details:

pyinstaller --onefile Full.py
39 INFO: PyInstaller: 3.2.dev0+e99e483
39 INFO: Python: 2.7.10
39 INFO: Platform: Windows-8-6.2.9200
42 INFO: wrote I:\Abhishek\Python\Weather Reporting\Weather Reporting 2\Full.spe
c
44 INFO: UPX is not available.
46 INFO: Extending PYTHONPATH with paths
['I:\\Abhishek\\Python\\Weather Reporting\\Weather Reporting 2',
 'I:\\Abhishek\\Python\\Weather Reporting\\Weather Reporting 2']
46 INFO: checking Analysis
46 INFO: Building Analysis because out00-Analysis.toc is non existent
46 INFO: Initializing module dependency graph...
49 INFO: Initializing module graph hooks...
88 INFO: running Analysis out00-Analysis.toc
90 INFO: Adding Microsoft.VC90.CRT to dependent assemblies of final executable
  required by C:\Python27\python.exe
200 INFO: Found C:\Windows\WinSxS\Manifests\amd64_policy.9.0.microsoft.vc90.crt_
1fc8b3b9a1e18e3b_9.0.21022.8_none_18f8a87fd1919cd9.manifest
201 INFO: Found C:\Windows\WinSxS\Manifests\amd64_policy.9.0.microsoft.vc90.crt_
1fc8b3b9a1e18e3b_9.0.30729.1_none_3da38fdebd0e6822.manifest
202 INFO: Found C:\Windows\WinSxS\Manifests\amd64_policy.9.0.microsoft.vc90.crt_
1fc8b3b9a1e18e3b_9.0.30729.4148_none_acd0e4ffe1daef0a.manifest
203 INFO: Found C:\Windows\WinSxS\Manifests\amd64_policy.9.0.microsoft.vc90.crt_
1fc8b3b9a1e18e3b_9.0.30729.6871_none_acd48825e1d7842d.manifest
313 INFO: Searching for assembly amd64_Microsoft.VC90.CRT_1fc8b3b9a1e18e3b_9.0.3
0729.6871_none ...
315 INFO: Found manifest C:\Windows\WinSxS\Manifests\amd64_microsoft.vc90.crt_1f
c8b3b9a1e18e3b_9.0.30729.6871_none_08e717a5a83adddf.manifest
316 INFO: Searching for file msvcr90.dll
317 INFO: Found file C:\Windows\WinSxS\amd64_microsoft.vc90.crt_1fc8b3b9a1e18e3b
_9.0.30729.6871_none_08e717a5a83adddf\msvcr90.dll
317 INFO: Searching for file msvcp90.dll
319 INFO: Found file C:\Windows\WinSxS\amd64_microsoft.vc90.crt_1fc8b3b9a1e18e3b
_9.0.30729.6871_none_08e717a5a83adddf\msvcp90.dll
319 INFO: Searching for file msvcm90.dll
320 INFO: Found file C:\Windows\WinSxS\amd64_microsoft.vc90.crt_1fc8b3b9a1e18e3b
_9.0.30729.6871_none_08e717a5a83adddf\msvcm90.dll
428 INFO: Found C:\Windows\WinSxS\Manifests\amd64_policy.9.0.microsoft.vc90.crt_
1fc8b3b9a1e18e3b_9.0.21022.8_none_18f8a87fd1919cd9.manifest
430 INFO: Found C:\Windows\WinSxS\Manifests\amd64_policy.9.0.microsoft.vc90.crt_
1fc8b3b9a1e18e3b_9.0.30729.1_none_3da38fdebd0e6822.manifest
431 INFO: Found C:\Windows\WinSxS\Manifests\amd64_policy.9.0.microsoft.vc90.crt_
1fc8b3b9a1e18e3b_9.0.30729.4148_none_acd0e4ffe1daef0a.manifest
432 INFO: Found C:\Windows\WinSxS\Manifests\amd64_policy.9.0.microsoft.vc90.crt_
1fc8b3b9a1e18e3b_9.0.30729.6871_none_acd48825e1d7842d.manifest
434 INFO: Adding redirect Microsoft.VC90.CRT version (9, 0, 21022, 8) -> (9, 0,
30729, 6871)
498 INFO: Analyzing I:\Abhishek\Python\Weather Reporting\Weather Reporting 2\Ful
l.py
2250 INFO: Looking for import hooks ...
2256 INFO: Processing hook   hook-httplib.py
2257 INFO: Processing hook   hook-pyttsx.py
2327 INFO: Processing pre-safe import module hook   win32com
2951 INFO: Processing pre-find module path hook   distutils
3052 INFO: Processing hook   hook-pywintypes.py
3177 INFO: Processing hook   hook-encodings.py
3540 INFO: Processing hook   hook-win32com.py
3600 INFO: Processing hook   hook-pythoncom.py
3728 INFO: Processing hook   hook-distutils.py
3746 INFO: Looking for ctypes DLLs
3757 INFO: Analyzing run-time hooks ...
3769 INFO: Including run-time hook 'pyi_rth_win32comgenpy.py'
3789 INFO: Looking for dynamic libraries
3996 INFO: Found C:\Windows\WinSxS\Manifests\amd64_policy.9.0.microsoft.vc90.mfc
_1fc8b3b9a1e18e3b_9.0.21022.8_none_1179c2b5d66019bc.manifest
3997 INFO: Found C:\Windows\WinSxS\Manifests\amd64_policy.9.0.microsoft.vc90.mfc
_1fc8b3b9a1e18e3b_9.0.30729.4148_none_a551ff35e6a96bed.manifest
4103 INFO: Searching for assembly amd64_Microsoft.VC90.MFC_1fc8b3b9a1e18e3b_9.0.
30729.4148_none ...
4105 INFO: Found manifest C:\Windows\WinSxS\Manifests\amd64_microsoft.vc90.mfc_1
fc8b3b9a1e18e3b_9.0.30729.4148_none_04480933ab2137b1.manifest
4106 INFO: Searching for file mfc90.dll
4106 INFO: Found file C:\Windows\WinSxS\amd64_microsoft.vc90.mfc_1fc8b3b9a1e18e3
b_9.0.30729.4148_none_04480933ab2137b1\mfc90.dll
4106 INFO: Searching for file mfc90u.dll
4108 INFO: Found file C:\Windows\WinSxS\amd64_microsoft.vc90.mfc_1fc8b3b9a1e18e3
b_9.0.30729.4148_none_04480933ab2137b1\mfc90u.dll
4108 INFO: Searching for file mfcm90.dll
4109 INFO: Found file C:\Windows\WinSxS\amd64_microsoft.vc90.mfc_1fc8b3b9a1e18e3
b_9.0.30729.4148_none_04480933ab2137b1\mfcm90.dll
4109 INFO: Searching for file mfcm90u.dll
4111 INFO: Found file C:\Windows\WinSxS\amd64_microsoft.vc90.mfc_1fc8b3b9a1e18e3
b_9.0.30729.4148_none_04480933ab2137b1\mfcm90u.dll
4217 INFO: Found C:\Windows\WinSxS\Manifests\amd64_policy.9.0.microsoft.vc90.mfc
_1fc8b3b9a1e18e3b_9.0.21022.8_none_1179c2b5d66019bc.manifest
4217 INFO: Found C:\Windows\WinSxS\Manifests\amd64_policy.9.0.microsoft.vc90.mfc
_1fc8b3b9a1e18e3b_9.0.30729.4148_none_a551ff35e6a96bed.manifest
4218 INFO: Adding redirect Microsoft.VC90.MFC version (9, 0, 21022, 8) -> (9, 0,
 30729, 4148)
4378 INFO: Looking for eggs
4379 INFO: Using Python library C:\Windows\system32\python27.dll
4379 INFO: Found binding redirects:
[BindingRedirect(name=u'Microsoft.VC90.MFC', language=None, arch=u'amd64', oldVe
rsion=(9, 0, 21022, 8), newVersion=(9, 0, 30729, 4148), publicKeyToken=u'1fc8b3b
9a1e18e3b'), BindingRedirect(name=u'Microsoft.VC90.CRT', language=None, arch=u'a
md64', oldVersion=(9, 0, 21022, 8), newVersion=(9, 0, 30729, 6871), publicKeyTok
en=u'1fc8b3b9a1e18e3b')]
4391 INFO: Warnings written to I:\Abhishek\Python\Weather Reporting\Weather Repo
rting 2\build\Full\warnFull.txt
4454 INFO: checking PYZ
4454 INFO: Building PYZ because out00-PYZ.toc is non existent
4455 INFO: Building PYZ (ZlibArchive) I:\Abhishek\Python\Weather Reporting\Weath
er Reporting 2\build\Full\out00-PYZ.pyz
4756 INFO: checking PKG
4756 INFO: Building PKG because out00-PKG.toc is non existent
4756 INFO: Building PKG (CArchive) out00-PKG.pkg
4828 INFO: Redirecting Microsoft.VC90.CRT version (9, 0, 21022, 8) -> (9, 0, 307
29, 6871)
8503 INFO: Bootloader C:\Python27\lib\site-packages\pyinstaller-3.2.dev0+e99e483
-py2.7.egg\PyInstaller\bootloader\Windows-64bit\run.exe
8503 INFO: checking EXE
8503 INFO: Building EXE because out00-EXE.toc is non existent
8504 INFO: Building EXE from out00-EXE.toc
8631 INFO: Appending archive to EXE I:\Abhishek\Python\Weather Reporting\Weather
 Reporting 2\dist\Full.exe
Run Details:

Traceback (most recent call last):
  File "<string>", line 155, in <module>
  File "site-packages\pyttsx\__init__.py", line 39, in init
  File "site-packages\pyttsx\engine.py", line 45, in __init__
  File "site-packages\pyttsx\driver.py", line 66, in __init__
  File "site-packages\pyttsx\drivers\sapi5.py", line 37, in buildDriver
  File "site-packages\pyttsx\drivers\sapi5.py", line 46, in __init__
  File "site-packages\win32com\client\__init__.py", line 309, in WithEvents
  File "site-packages\win32com\client\gencache.py", line 524, in EnsureModule
  File "site-packages\win32com\client\gencache.py", line 291, in MakeModuleForTy
pelib
  File "site-packages\win32com\client\makepy.py", line 286, in GenerateFromTypeL
ibSpec
  File "site-packages\win32com\client\gencache.py", line 554, in AddModuleToCach
e
  File "site-packages\win32com\client\gencache.py", line 633, in _GetModule
  File "c:\users\shubham\appdata\local\temp\tmpi0rbcs\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-3.2.dev0+e99e483-py2.7.egg\PyI
nstaller\loader\pyimod03_importers.py", line 158, in load_module
    return self._importer.load_module(fullname, self._fullname)
  File "c:\python27\lib\site-packages\PyInstaller-3.2.dev0+e99e483-py2.7.egg\PyI
nstaller\loader\pyimod03_importers.py", line 389, in load_module
    exec(bytecode, module.__dict__)
  File "site-packages\pythoncom.py", line 2, in <module>
  File "c:\python27\lib\site-packages\PyInstaller-3.2.dev0+e99e483-py2.7.egg\PyI
nstaller\loader\pyimod03_importers.py", line 158, in load_module
    return self._importer.load_module(fullname, self._fullname)
  File "c:\python27\lib\site-packages\PyInstaller-3.2.dev0+e99e483-py2.7.egg\PyI
nstaller\loader\pyimod03_importers.py", line 389, in load_module
    exec(bytecode, module.__dict__)
  File "site-packages\win32\lib\pywintypes.py", line 2, in <module>
  File "c:\python27\lib\site-packages\PyInstaller-3.2.dev0+e99e483-py2.7.egg\PyI
nstaller\loader\pyimod03_importers.py", line 158, in load_module
    return self._importer.load_module(fullname, self._fullname)
  File "c:\python27\lib\site-packages\PyInstaller-3.2.dev0+e99e483-py2.7.egg\PyI
nstaller\loader\pyimod03_importers.py", line 389, in load_module
    exec(bytecode, module.__dict__)
  File "os.py", line 120, in <module>
ImportError: No module named path
Full returned -1

Here "Full" is the name of my script.

Any suggestions are invited.

spreadred commented 8 years ago

"ImportError: No module named path" - Looks like its having trouble finding the path module, which I believe is part of the os module.

a4abhishek commented 8 years ago

Thanx for your attention but, what should I do now.