I use Python Cheetah to generate templates, and I cannot get it to use the compiled _namemapper.so library that is installed. I am running CentOS 5.4 with Python 2.4 installed using Cheetah 2.4.3. I canβt get Cheetah to use the _namemapper.so file that I created during installation during my life:
Filling conf/asterisk/sip.conf.ect -> conf/asterisk/sip.conf ... /usr/lib64/python2.4/site-packages/Cheetah/Compiler.py:1508: UserWarning: You don't have the C version of NameMapper installed! I'm disabling Cheetah 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.
However, I do have a shared library sitting next to the NameMapper modules:
$ ls -ltr /usr/lib64/python2.4/site-packages/Cheetah/ | grep -i namemap -rw-r
I tried adding this directory to /etc/ld.so.conf.d/python-cheetah.conf and the _namemapper.so shared library _namemapper.so not found.
Any ideas?
solvable
Thanks @ alex-b. It turns out that I compiled Cheetah on a 32-bit machine and tried to load the shared library on a 64-bit machine. D'o!
>>> from Cheetah._namemapper import NotFound Traceback (most recent call last): File "<stdin>", line 1, in ? ImportError: /usr/lib/python2.4/site-packages/Cheetah/_namemapper.so: wrong ELF class: ELFCLASS32
Then I ran into the following problem:
>>> from Cheetah._namemapper import NotFound Traceback (most recent call last): File "<stdin>", line 1, in ? ImportError: /usr/lib/python2.4/site-packages/Cheetah/_namemapper.so: undefined symbol: PyUnicode_FromFormat
And it turns out that Cheetah does not work so well on Python <= 2.6, so I will update.
source share