Re: [PythonReports-users] PythonReports and py2exe
Brought to you by:
a1s
From: alexander s. <al...@go...> - 2013-01-04 08:47:29
|
On 03.01.2013 20:59, Werner F. Bruhin wrote: > > I use py2exe and InnoSetup to generate an installer. > > Updated my setup.py to ensure that PythonReports and reportlab get > included by py2exe by adding them to "packages" option. PythonReports should be found without explicit include. For my other project (no wx part, only reportlab-based builder and pdf output), I use "includes": [ "PythonReports.PILDrivers", "PythonReports.RLDrivers", ], "excludes": [ "tcl", "Tkinter", "_tkinter", ], > However the way images are handled in PythonReports I run into this error: > > 19:39:52: can't open file 'C:\Program Files\TheWineCellarBookV4\lib\library.zip\PythonReports\editor\res\pythonreports.ico' (error 3: le chemin d'accès spécifié est introuvable.) > 19:39:52: No handler found for image type. > > The French text means "access path is not found", however if I check the > library.zip file it does contain the image, but I think > "AddIconFromFile" can't deal with this path (and/or extracting from a > zip archive). No, it can't. The resources are to be packaged as data files, separate from library.zip. I have planned to add a check for ".zip" in module path to editor.utils.get_resource_dir(). In your case, the path would be 'C:\Program Files\TheWineCellarBookV4\lib\res\pythonreports.ico' - with directories up to and including library.zip removed by get_resource_dir(). > To get the images into the library.zip I had to do a hack in the > setup.py to manually update the library.zip. > > The nicest way, in my view, would be to have the images in a resource > file created by imp2py (wxPython tools). That approach should then be > fine regards less of py2exe options/configuration (and should also work > for other freezing tools, cxfrezze etc). I think that img2py will do, too. Best wishes, alex. |