Hello guys, I figured out that there is no Problem when building just with the -- onfile OR the --tk option! Unfortunately I'm not familiar with the internal packing /unpacking process of PyInstaller but seems to be a general bug in PyInstaller or something !?
I also found a litte workaround for this Problem at http://www.python-forum.de/viewtopic.php?p=188247#p188247 Updating the testscript to: # >>> import os, sys, win32com if getattr(sys, 'frozen', False) and os.getenv('_MEIPASS2'): win32com.__gen_path__ = os.path.join(os.environ['_MEIPASS2'], 'gen_py') os.mkdir(win32com.__gen_path__) sys.modules["win32com.gen_py"].__path__ = win32com.__gen_path__ print 'Before importing win32com.client' import win32com.client print 'after importing win32com.client' raw_input('This is the end...') # <<< ... everything is ok. Greetings, Simon On 6 Sep., 13:44, simon2k <[email protected]> wrote: > Hello everybody, > > I'got a little confusing issue here, using PyInstaller v 1.5.1 and > Python v2.7.1. > > Here is my little Testscript to compile to onefile: > # >>> > print 'Before importing win32com.client' > import win32com.client > print 'after importing win32com.client' > > raw_input('This is the end...') > # <<< > > Building an exe out of this script causes no errors EXCEPT use the -- > tk option! > Using "--tk" - option at generating the spec raises the following > Excption at starting the exe: > > ##################### > Traceback (most recent call last): > File "<string>", line 3, in <module> > File "C:\pyinstaller-1.5\iu.py", line 436, in importHook > mod = _self_doimport(nm, ctx, fqname) > File "C:\pyinstaller-1.5\iu.py", line 521, in doimport > exec co in mod.__dict__ > File "C:\pyinstaller-1.5\test\build\pyi.win32\test\outPYZ1.pyz/ > win32com.client", line 11, in <module> > File "C:\pyinstaller-1.5\iu.py", line 436, in importHook > mod = _self_doimport(nm, ctx, fqname) > File "C:\pyinstaller-1.5\iu.py", line 521, in doimport > exec co in mod.__dict__ > File "C:\pyinstaller-1.5\test\build\pyi.win32\test\outPYZ1.pyz/ > win32com.client.gencache", line 662, in <module> > File "C:\pyinstaller-1.5\test\build\pyi.win32\test\outPYZ1.pyz/ > win32com.client.gencache", line 58, in __init__ > File "C:\pyinstaller-1.5\test\build\pyi.win32\test\outPYZ1.pyz/ > win32com.client.gencache", line 649, in Rebuild > File "C:\pyinstaller-1.5\test\build\pyi.win32\test\outPYZ1.pyz/ > win32com.client.gencache", line 65, in _SaveDicts > File "C:\pyinstaller-1.5\test\build\pyi.win32\test\outPYZ1.pyz/ > win32com.client.gencache", line 141, in GetGeneratePath > IOError: [Errno 2] No such file or directory: 'C:\make_exe_271\ > \pyinstaller-1.5\\test\\dist\\test.exe?839743\\__init__.py' > RC: -1 from test > OK. > #################### > > I'm very confused because using PyiInstraller v1.3 and Python v2.2 > there is no Problem at this Point! > > I hope you can help me out with that! > > Thanks! > > Greetings, > Simon -- You received this message because you are subscribed to the Google Groups "PyInstaller" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/pyinstaller?hl=en.
