MAko Template Library Installation Help Required

362 views
Skip to first unread message

Abhishek Banerjee

unread,
Dec 16, 2014, 10:09:51 AM12/16/14
to mako-d...@googlegroups.com
Hi,

Can you please resolve my problem statement?
I am working on 
SUSE Linux Enterprise Server 10 (x86_64)
VERSION = 10
PATCHLEVEL = 4

Python 2.4.2 (#1, May  6 2011, 13:26:21)
[GCC 4.1.2 20070115 (SUSE Linux)] 

I have built a reconciling tool on Python and using Mako Template Library for HTML reporting.

I downloaded the Mako-1.0.0 library and tried to install it using the following command but encountered the error:
$temp/Mako-1.0.0> python setup.py install
Traceback (most recent call last):
  File "setup.py", line 1, in ?
    from setuptools import setup, find_packages
ImportError: No module named setuptools

as a workaround i have use the following in my code:
sys.path.append('/local/home/clfiqatest2/temp/Mako-1.0.0/')
import mako.template

But i am getting the following error:
 Traceback (most recent call last):
  File "Calypso.py", line 10, in ?
    import mako.template
  File "/local/home/clfiqatest2/temp/Mako-1.0.0/mako/template.py", line 10, in ?
    from mako.lexer import Lexer
  File "/local/home/clfiqatest2/temp/Mako-1.0.0/mako/lexer.py", line 11, in ?
    from mako import parsetree, exceptions, compat
  File "/local/home/clfiqatest2/temp/Mako-1.0.0/mako/parsetree.py", line 9, in ?
    from mako import exceptions, ast, util, filters, compat
  File "/local/home/clfiqatest2/temp/Mako-1.0.0/mako/exceptions.py", line 11, in ?
    from mako import util, compat
  File "/local/home/clfiqatest2/temp/Mako-1.0.0/mako/util.py", line 11, in ?
    from mako import compat
  File "/local/home/clfiqatest2/temp/Mako-1.0.0/mako/compat.py", line 115, in ?
    all = all
NameError: name 'all' is not defined

Michael Bayer

unread,
Dec 16, 2014, 10:12:25 AM12/16/14
to mako-d...@googlegroups.com
1. Mako 1.0 requires Python 2.6 or above



--
You received this message because you are subscribed to the Google Groups "Mako Templates for Python" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mako-discuss...@googlegroups.com.
To post to this group, send email to mako-d...@googlegroups.com.
Visit this group at http://groups.google.com/group/mako-discuss.
For more options, visit https://groups.google.com/d/optout.

Abhishek Banerjee

unread,
Dec 16, 2014, 10:38:23 AM12/16/14
to mako-d...@googlegroups.com
In the mako Homepage it lists:

  • Supports Python 2.4 through modern 3 versions. What is the right version for Python 2.4?

Michael Bayer

unread,
Dec 16, 2014, 1:29:38 PM12/16/14
to mako-d...@googlegroups.com
On Dec 16, 2014, at 10:38 AM, Abhishek Banerjee <abhi...@gmail.com> wrote:

In the mako Homepage it lists:

  • Supports Python 2.4 through modern 3 versions. What is the right version for Python 2.4?

whoops, just updated that, thanks.  

You can use any version prior to 1.0 for python 2.4, but you need to install it correctly still using easy_install, pip, or “python setup.py install”.

Abhishek Banerjee

unread,
Dec 22, 2014, 11:52:53 AM12/22/14
to mako-d...@googlegroups.com
Please help : I am encountering:

  File "Calypso.py", line 1046, in cashsummaryreport
    tmpl = mako.template.Template(filename=os.path.join(os.curdir,"templates","Summary.html"),strict_undefined=True,cache_enabled=True)
NameError: global name 'mako' is not defined

I have referenced the Mako library as 
sys.path.append('/local/home/clfiqatest2/temp/Mako-0.8.1/')
from mako.runtime import *
from mako.template import *
Reply all
Reply to author
Forward
0 new messages