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