python2.7 Cheetah You don't have the C version of NameMapper installed

问题:You don't have the C version of NameMapper installed

sudo vi /usr/lib/python2.7/site-packages/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."
            self.setSetting('useStackFrames', False)

替换成

if not NameMapper.C_VERSION:
            if not sys.platform.startswith('java'):
                pass
                #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."
                #    )
            self.setSetting('useStackFrames', False)

猜你喜欢

转载自www.cnblogs.com/jiangxiaoxian/p/10609058.html
今日推荐