一、安装Cheetah
下载地址:https://pypi.python.org/pypi/Cheetah/2.4.4
Cheetah-2.4.4.tar.gz
DOS命令下进入目录C:\Cheetah-2.4.4\Cheetah-2.4.4
执行以下命令:
python setup.py build
python setup.py install
二、问题:You don't have the C version of NameMapper installed
解决:
找到C:\Python27\Lib\site-packages\Cheetah-2.4.4-py2.7.egg\Cheetah\Compiler.py文件,
将第1506行起以下代码注释掉:
if not NameMapper.C_VERSION:
if not sys.platform.startswith('java'):
warnings.warn(
"\nYou don't have the C version of NameMapper installed! "
"I'm disabling Cheetah's useStackFrames option as it is "
"painfully slow with the Python version of NameMapper. "
"You should get a copy of Cheetah with the compiled C version of NameMapper."
)