安装lxml模块后,我的脚本在Ubuntu 10.10的原始版本上成功运行。(Python2.6.6)
所以我手动编译并安装了pyhton2.7(从源代码)。我的剧本不起作用了:Error: ImportError: No module named lxml
我已经返回到python2.6.7(来自源代码),但错误仍在发生。调用正确的python版本(2.6.7)。
注意:错误发生后,我多次删除并重新安装了包python-lxml。错误仍然存在:sudo aptitude install pyhton-lxml
我需要执行某种神奇的脚本来让python找到模块吗?
下面是命令的输出:strace ./RunScriptPython.py(带有python -v)$ strace ./RunScriptPython.sh
execve("./RunScriptPython.sh", ["./RunScriptPython.sh"], [/* 38 vars */]) = 0
brk(0) = 0x9be3000
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
mmap2(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb770c000
access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=81621, ...}) = 0
mmap2(NULL, 81621, PROT_READ, MAP_PRIVATE, 3, 0) = 0xb76f8000
close(3) = 0
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
open("/lib/libc.so.6", O_RDONLY) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0@n\1\0004\0\0\0"..., 512) = 512
fstat64(3, {st_mode=S_IFREG|0755, st_size=1421892, ...}) = 0
mmap2(NULL, 1427880, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x1d7000
mmap2(0x32e000, 12288, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x157) = 0x32e000
mmap2(0x331000, 10664, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x331000
close(3) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb76f7000
set_thread_area({entry_number:-1 -> 6, base_addr:0xb76f78d0, limit:1048575, seg_32bit:1, contents:0, read_exec_only:0, limit_in_pages:1, seg_n