On 8/25/2009 8:32 PM, Jason Kenney wrote:
> On Tue, Aug 25, 2009 at 3:30 AM, Giovanni Bajo <[email protected] 
> <mailto:[email protected]>> wrote:
> 
> 
>     On Sun, 23 Aug 2009 12:55:19 -0700 (PDT), Jason Kenney
>     <[email protected] <mailto:[email protected]>> wrote:
> 
>      > I've found that if I manually add wx.pth to the directory with the
>      > exe, the program runs correctly.  Is there a way to automate adding
>      > this file?
> 
>     The .spec file is a Python file. You can manually copy the file by
>     adding
>     some code there, or try using a COLLECT() step which is meant to collect
>     additional files (see the .spec file generated by Makespec.py
>     --onedir to
>     see how COLLECT is used). Of course, I'm sure you realize that manually
>     copying that file is just a workaround, not a fix.
> 
>      > Is this file usually added, and I have a borked install of
>      > some sort, or is path/version info handled differently altogether?
> 
>     No, the file should not be copied. The .pth file is meant to setup the
>     PYTHONPATH at runtime and it's not useful for a packed executable, since
>     the correct .pyc files are already bundled within the executable and
>     there's no need for PYTHONPATH games.
> 
>     It is possible that wxPython has some custom code that looks for a data
>     file within its installation directory, something like version.dat or
>     similar. You will need to look within wxPython code and find the
>     spot where
>     it does this check. If you can point me to the code, we can study it
>     together and see if there is a way to disable it for generated
>     executables.
> 
> 
> Thanks for the hints.  I tracked down the error message to wxversion.py 
> (installed in the site-packages dir).  In the preamble, it mentions not 
> to use it when bundling your files for a stand-alone app.  I guess 
> wxPython must use wxversion by default and it looks for wx.pth?  In any 
> event, I added C:\Python25\Lib\site-packages\wx-2.8-msw-unicode\wxPython 
> to my PYTHONPATH and now the built exe runs with no problems.

Great. I think we should try adding a hook to avoid this problem to 
happen for other people as well.

Can you try adding a hook file to the "hooks" directory called 
"hook-wxversion.py", and make it raise a RuntimeError() exception 
describing the problem?

Thanks!
-- 
Giovanni Bajo
Develer S.r.l.
http://www.develer.com

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to