我计划在Windows中使用wsgi + mako。
我使用以下命令安装mako
C:\wsgi>c:\Python26\Scripts\easy_install.exe Mako没有错误。我得到了
Finished processing dependencies for Mako在消息的末尾。
我检查了我的Python目录,我的结构如下:
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我运行以下代码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]我得到以下错误日志:
[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有什么建议吗?
发布于 2010-02-05 16:33:01
以下是一些值得尝试的事情
import mako,并查看是否出现类似的错误repr(mako)的值并确保它与您拥有的路径相对应。https://stackoverflow.com/questions/2205836
复制相似问题