I have Python 2.7 installed on my windows system with Cheetah. Below is the error i am getting, when i try to use the cheetah.template object with the .tmpl file.
from Cheetah.Template import Template
t = Template(file='home.tmpl')
C:\wamp\bin\Python27\lib\site-packages\Cheetah\Compiler.py:1509: UserWarning:
You don't have the C version of NameMapper installed! I'm disabling Cheetah's us
eStackFrames option as it is painfully slow with the Python version of NameMappe
r. You should get a copy of Cheetah with the compiled C version of NameMapper.
"\nYou don't have the C version of NameMapper installed! "
from Cheetah.Template import Template
t = Template(file='home.tmpl')
print t
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\wamp\bin\Python27\lib\site-packages\Cheetah\Template.py", line 1005,
in __str__
rc = getattr(self, mainMethName)()
File "_wamp_www_b121pyraw_b121pycheetah_home_tmpl.py", line 89, in respond
File "C:\wamp\bin\Python27\lib\site-packages\Cheetah\NameMapper.py", line 246,
in valueFromSearchList
_raiseNotFoundException(key, searchList)
File "C:\wamp\bin\Python27\lib\site-packages\Cheetah\NameMapper.py", line 167,
in _raiseNotFoundException
raise NotFound(excString)
Cheetah.NameMapper.NotFound: cannot find 'firstdivcontents'
I searched for _namemapper.pyd for python 2.7, but i am not getting. I found the file for upto 2.6 only. Do i have to downgrade to python 2.6, or is there any other method to install it.
And also how to install _namemapper.pyd to work with python, if at all i find it ?
The pyd files are created by compiling the C files which comes with the Package. This is done on installing, if you have a C compiler handy. If not, you in this case get a Python fall back. Some packages will just refuse to install.
The solution for Windows people without a C compiler is to install pre-compiled C binary packages. Cheetah seems to not have any: http://pypi.python.org/pypi/Cheetah/2.4.4
So you would need to install a C-compiler. MinGW is a good option, I hear.
However, I don't think that is your problem at all. Your actual error seems to have nothing to do with this warning.
So if you include your failing code, people more used to Cheetah than me can probably tell you what is wrong.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With