姜小嫌

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

问题: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)

posted on 2019-03-27 17:25  姜小嫌  阅读(2167)  评论(0编辑  收藏  举报