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)


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM