ubuntu 11.04具有本机
python2.7,我从源代码生成python2.5到/usr/local/python2.5/bin,并尝试为我的自定义python2.5安装安装lxml.另外我使用virtualenv.我用python2.5切换到我的env.在导入lxml我有一个错误.
from lxml import etree ImportError: /home/se7en/.virtualenvs/e-py25/lib/python2.5/site-packages/lxml-2.2.4-py2.5-linux-i686.egg/lxml/etree.so: undefined symbol: PyUnicodeUCS2_DecodeLatin1
使用python2.7 env,一切都可以,但在python2.5导入失败.请帮忙解决python2.5?
ldd /home/se7en/.virtualenvs/e-py25/lib/python2.5/site-packages/lxml-2.2.4-py2.5-linux-i686.egg/lxml/etree.so
结果:
(e-py25)se7en@se7en-R510-P510:~/downloads/lxml-2.2.4$ldd /home/se7en/.virtualenvs/e-py25/lib/python2.5/site-packages/lxml-2.2.4-py2.5-linux-i686.egg/lxml/etree.so linux-gate.so.1 => (0x00968000) libxslt.so.1 => /usr/lib/libxslt.so.1 (0x005aa000) libexslt.so.0 => /usr/lib/libexslt.so.0 (0x00110000) libxml2.so.2 => /usr/lib/libxml2.so.2 (0x00db3000) libz.so.1 => /lib/i386-linux-gnu/libz.so.1 (0x00a22000) libm.so.6 => /lib/i386-linux-gnu/libm.so.6 (0x00564000) libpthread.so.0 => /lib/i386-linux-gnu/libpthread.so.0 (0x00123000) libc.so.6 => /lib/i386-linux-gnu/libc.so.6 (0x0013c000) libgcrypt.so.11 => /lib/i386-linux-gnu/libgcrypt.so.11 (0x0029d000) libdl.so.2 => /lib/i386-linux-gnu/libdl.so.2 (0x00d6e000) /lib/ld-linux.so.2 (0x004fc000) libgpg-error.so.0 => /lib/i386-linux-gnu/libgpg-error.so.0 (0x00879000) (e-py25)se7en@se7en-R510-P510:~/downloads/lxml-2.2.4$