Hi, does anyone knows the answer? Or should I file a bug on it?

I know pyinstaller-1.4 has the hidden import hook for Mako. But it
just breaks one me. BTW, I use Mako-0.3.2

Thanks,
Feng

On Mar 29, 11:48 pm, Feng <[email protected]> wrote:
> Hi, could somebody help? Thanks in advance! - Feng
>
> I use Mako in my python codes. However, when I used pyinstaller to
> build --onefile. The result binary failed with below message:
>
> """
>   File "bin/template-mako-module/highlight.html.py", line 2, in
> <module>
>     from mako import runtime, filters, cache
>   File "/home/feng/dev/pyinstaller-1.4/iu.py", line 477, in importHook
>     mod = self.doimport(nm, ctx, ctx+'.'+nm)
>   File "/home/feng/dev/pyinstaller-1.4/iu.py", line 521, in doimport
>     exec co in mod.__dict__
>   File "/home/feng/runs/r2010-03-26/bin/build/pyi.linux2/backend.py/
> outPYZ1.pyz/mako.cache", line 4, in <module>
>   File "/home/feng/dev/pyinstaller-1.4/iu.py", line 477, in importHook
>     mod = self.doimport(nm, ctx, ctx+'.'+nm)
>   File "/home/feng/dev/pyinstaller-1.4/iu.py", line 521, in doimport
>     exec co in mod.__dict__
>   File "/home/feng/runs/r2010-03-26/bin/build/pyi.linux2/backend.py/
> outPYZ1.pyz/beaker.cache", line 13, in <module>
>   File "/home/feng/dev/pyinstaller-1.4/iu.py", line 436, in importHook
>     mod = _self_doimport(nm, ctx, fqname)
>   File "/home/feng/dev/pyinstaller-1.4/iu.py", line 521, in doimport
>     exec co in mod.__dict__
>   File "/home/feng/runs/r2010-03-26/bin/build/pyi.linux2/backend.py/
> outPYZ1.pyz/beaker.container", line 2, in <module>
>   File "/home/feng/dev/pyinstaller-1.4/iu.py", line 436, in importHook
>     mod = _self_doimport(nm, ctx, fqname)
>   File "/home/feng/dev/pyinstaller-1.4/iu.py", line 521, in doimport
>     exec co in mod.__dict__
>   File "/home/feng/runs/r2010-03-26/bin/build/pyi.linux2/backend.py/
> outPYZ1.pyz/anydbm", line 54, in <module>
>   File "/home/feng/dev/pyinstaller-1.4/iu.py", line 436, in importHook
>     mod = _self_doimport(nm, ctx, fqname)
>   File "/home/feng/dev/pyinstaller-1.4/iu.py", line 521, in doimport
>     exec co in mod.__dict__
>   File "bin/build/pyi.linux2/backend.py/outPYZ1.pyz/dbhash", line 8,
> in <module>
>   File "/home/feng/dev/pyinstaller-1.4/iu.py", line 436, in importHook
>     mod = _self_doimport(nm, ctx, fqname)
>   File "/home/feng/dev/pyinstaller-1.4/iu.py", line 531, in doimport
>     del sys.modules[fqname]
> KeyError: 'bsddb'
> """
>
> The environment I am in:
> Linux localhost.localdomain 2.6.18-164.15.1.el5 #1 SMP Mon Mar 1
> 10:56:08 EST 2010 x86_64 x86_64 x86_64 GNU/Linux
> Python 2.6.4 (r264:75706, Nov  8 2009, 22:19:08)
> [GCC 4.1.2 20080704 (Red Hat 4.1.2-44)] on linux2
>
> The code snippet I used:
> """
> import mako.lookup
>
> def set_template_lookup():
>     global template_lookup
>     template_lookup = mako.lookup.TemplateLookup(
>             directories=[cmdline.mako_template_dir],
>             module_directory='%s-mako-module' %
> cmdline.mako_template_dir)
> ...
> html_template = template_lookup.get_template("highlight.html")
> ...
> """
>
> And I used below commandline:
> python2.6 Makespec.py --strip  --onefile --name=backend.py --out=bin
> backend.py
> python2.6 Build.py bin/backend.py.spec

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