Install Mako In Windows

1,245 views
Skip to first unread message

yccheok

unread,
Feb 5, 2010, 3:19:08 AM2/5/10
to Mako Templates for Python
I plan to use wsgi + mako in Windows.

I install mako using

C:\wsgi>c:\Python26\Scripts\easy_install.exe Mako

No error. I get

Finished processing dependencies for Mako

at end of the message.

I check my Python directory, I am having the following structure :

C:\Python26\Lib\site-packages\mako-0.2.5-py2.6.egg
C:\Python26\Lib\site-packages\mako-0.2.5-py2.6.egg\EGG-INFO
C:\Python26\Lib\site-packages\mako-0.2.5-py2.6.egg\mako
C:\Python26\Lib\site-packages\mako-0.2.5-py2.6.egg\mako\ext

I run the following code HelloWorld.py

from mako.template import Template

def application(environ, start_response):
status = '200 OK'

mytemplate = Template("hello, ${name}!")
output = mytemplate.render(name="jack")

response_headers = [('Content-type', 'text/plain'),
('Content-Length', str(len(output)))]
start_response(status, response_headers)

return [output]

I get the following error log :

[Fri Feb 05 16:11:19 2010] [error] [client 127.0.0.1] File "C:/wsgi/
HelloWorld.py", line 1, in <module>
[Fri Feb 05 16:11:19 2010] [error] [client 127.0.0.1] from
mako.template import Template
[Fri Feb 05 16:11:19 2010] [error] [client 127.0.0.1] ImportError: No
module named mako.template

Any advice?

Etienne Robillard

unread,
Feb 5, 2010, 1:05:56 PM2/5/10
to mako-d...@googlegroups.com

you can check if the Mako package has been installed correctly with
the -c switch, from command line, or using interactive shell. This will
help you nail down the issue.

$ python -c 'import mako'
$ python
>>> import mako
>>>

hope this helps,

Etienne


robillard_etienne.vcf
Reply all
Reply to author
Forward
0 new messages