Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7427879
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T08:39:12+00:00 2026-05-29T08:39:12+00:00

My script run successfully on original version of Ubuntu 10.10 after installing the lxml

  • 0

My script run successfully on original version of Ubuntu 10.10 after installing the lxml module. (python 2.6.6)

So I’ve compiled and installed manually the pyhton2.7 (from the source code). My script did not worked anymore:

Error: ImportError: No module named lxml

I’ve returned to the python2.6.7 (from the source code), but the error keep happening. The right python version (2.6.7) is invoked.

Note: I removed and reinstalled the package python-lxml many times after the error. The error remains:

sudo aptitude install pyhton-lxml

Do I have to execute some kind of magical script to python finding the module?

Bellow is the output of the command: strace ./RunScriptPython.py (with 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_not_present:0, useable:1}) = 0
mprotect(0x32e000, 8192, PROT_READ)     = 0
mprotect(0x805c000, 4096, PROT_READ)    = 0
mprotect(0xf33000, 4096, PROT_READ)     = 0
munmap(0xb76f8000, 81621)               = 0
getpid()                                = 3006
rt_sigaction(SIGCHLD, {SIG_DFL, [CHLD], SA_RESTART}, {SIG_DFL, [], 0}, 8) = 0
geteuid32()                             = 905975433
brk(0)                                  = 0x9be3000
brk(0x9c04000)                          = 0x9c04000
getppid()                               = 3005
stat64("/home/CEDROFINANCES/alexander.miro/dev/cedro/20120113_8P_Correcoes_linux/tools/bean_maker", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
stat64(".", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
open("./RunScriptPython.sh", O_RDONLY)  = 3
fcntl64(3, F_DUPFD, 10)                 = 10
close(3)                                = 0
fcntl64(10, F_SETFD, FD_CLOEXEC)        = 0
rt_sigaction(SIGINT, NULL, {SIG_DFL, [], 0}, 8) = 0
rt_sigaction(SIGINT, {0x8056690, ~[RTMIN RT_1], 0}, NULL, 8) = 0
rt_sigaction(SIGQUIT, NULL, {SIG_DFL, [], 0}, 8) = 0
rt_sigaction(SIGQUIT, {SIG_DFL, ~[RTMIN RT_1], 0}, NULL, 8) = 0
rt_sigaction(SIGTERM, NULL, {SIG_DFL, [], 0}, 8) = 0
rt_sigaction(SIGTERM, {SIG_DFL, ~[RTMIN RT_1], 0}, NULL, 8) = 0
read(10, "#!/bin/sh\nrm -rf ../../broker_co"..., 8192) = 325
open("../../broker_communication/beans", O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_DIRECTORY|O_CLOEXEC) = 3
fcntl64(3, F_GETFD)                     = 0x1 (flags FD_CLOEXEC)
getdents(3, /* 3 entries */, 32768)     = 48
getdents(3, /* 0 entries */, 32768)     = 0
close(3)                                = 0
stat64("/usr/local/sbin/rm", 0xbf926940) = -1 ENOENT (No such file or directory)
stat64("/usr/local/bin/rm", 0xbf926940) = -1 ENOENT (No such file or directory)
stat64("/usr/sbin/rm", 0xbf926940)      = -1 ENOENT (No such file or directory)
stat64("/usr/bin/rm", 0xbf926940)       = -1 ENOENT (No such file or directory)
stat64("/sbin/rm", 0xbf926940)          = -1 ENOENT (No such file or directory)
stat64("/bin/rm", {st_mode=S_IFREG|0755, st_size=46756, ...}) = 0
clone(child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0xb76f7938) = 3007
wait4(-1, [{WIFEXITED(s) && WEXITSTATUS(s) == 0}], 0, NULL) = 3007
--- SIGCHLD (Child exited) @ 0 (0) ---
open("../../broker_communication/fix_translation", O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_DIRECTORY|O_CLOEXEC) = 3
getdents(3, /* 3 entries */, 32768)     = 48
getdents(3, /* 0 entries */, 32768)     = 0
close(3)                                = 0
clone(child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0xb76f7938) = 3008
wait4(-1, [{WIFEXITED(s) && WEXITSTATUS(s) == 0}], 0, NULL) = 3008
--- SIGCHLD (Child exited) @ 0 (0) ---
stat64("/usr/local/sbin/python", 0xbf926940) = -1 ENOENT (No such file or directory)
stat64("/usr/local/bin/python", {st_mode=S_IFREG|0755, st_size=4081553, ...}) = 0
clone(child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0xb76f7938) = 3009
wait4(-1, # installing zipimport hook
import zipimport # builtin
# installed zipimport hook
# /usr/local/lib/python2.6/site.pyc matches /usr/local/lib/python2.6/site.py
import site # precompiled from /usr/local/lib/python2.6/site.pyc
# /usr/local/lib/python2.6/os.pyc matches /usr/local/lib/python2.6/os.py
import os # precompiled from /usr/local/lib/python2.6/os.pyc
import errno # builtin
import posix # builtin
# /usr/local/lib/python2.6/posixpath.pyc matches /usr/local/lib/python2.6/posixpath.py
import posixpath # precompiled from /usr/local/lib/python2.6/posixpath.pyc
# /usr/local/lib/python2.6/stat.pyc matches /usr/local/lib/python2.6/stat.py
import stat # precompiled from /usr/local/lib/python2.6/stat.pyc
# /usr/local/lib/python2.6/genericpath.pyc matches /usr/local/lib/python2.6/genericpath.py
import genericpath # precompiled from /usr/local/lib/python2.6/genericpath.pyc
# /usr/local/lib/python2.6/warnings.pyc matches /usr/local/lib/python2.6/warnings.py
import warnings # precompiled from /usr/local/lib/python2.6/warnings.pyc
# /usr/local/lib/python2.6/linecache.pyc matches /usr/local/lib/python2.6/linecache.py
import linecache # precompiled from /usr/local/lib/python2.6/linecache.pyc
# /usr/local/lib/python2.6/types.pyc matches /usr/local/lib/python2.6/types.py
import types # precompiled from /usr/local/lib/python2.6/types.pyc
# /usr/local/lib/python2.6/UserDict.pyc matches /usr/local/lib/python2.6/UserDict.py
import UserDict # precompiled from /usr/local/lib/python2.6/UserDict.pyc
# /usr/local/lib/python2.6/_abcoll.pyc matches /usr/local/lib/python2.6/_abcoll.py
import _abcoll # precompiled from /usr/local/lib/python2.6/_abcoll.pyc
# /usr/local/lib/python2.6/abc.pyc matches /usr/local/lib/python2.6/abc.py
import abc # precompiled from /usr/local/lib/python2.6/abc.pyc
# /usr/local/lib/python2.6/copy_reg.pyc matches /usr/local/lib/python2.6/copy_reg.py
import copy_reg # precompiled from /usr/local/lib/python2.6/copy_reg.pyc
import encodings # directory /usr/local/lib/python2.6/encodings
# /usr/local/lib/python2.6/encodings/__init__.pyc matches /usr/local/lib/python2.6/encodings/__init__.py
import encodings # precompiled from /usr/local/lib/python2.6/encodings/__init__.pyc
# /usr/local/lib/python2.6/codecs.pyc matches /usr/local/lib/python2.6/codecs.py
import codecs # precompiled from /usr/local/lib/python2.6/codecs.pyc
import _codecs # builtin
# /usr/local/lib/python2.6/encodings/aliases.pyc matches /usr/local/lib/python2.6/encodings/aliases.py
import encodings.aliases # precompiled from /usr/local/lib/python2.6/encodings/aliases.pyc
# /usr/local/lib/python2.6/encodings/utf_8.pyc matches /usr/local/lib/python2.6/encodings/utf_8.py
import encodings.utf_8 # precompiled from /usr/local/lib/python2.6/encodings/utf_8.pyc
Python 2.6.7 (r267:88850, Jan 30 2012, 14:30:06) 
[GCC 4.4.5] on linux2
Type "help", "copyright", "credits" or "license" for more information.
Traceback (most recent call last):
  File "bean_maker.py", line 1, in <module>
    from lxml import etree
ImportError: No module named lxml
# clear __builtin__._
# clear sys.path
# clear sys.argv
# clear sys.ps1
# clear sys.ps2
# clear sys.exitfunc
# clear sys.exc_type
# clear sys.exc_value
# clear sys.exc_traceback
# clear sys.last_type
# clear sys.last_value
# clear sys.last_traceback
# clear sys.path_hooks
# clear sys.path_importer_cache
# clear sys.meta_path
# clear sys.flags
# clear sys.float_info
# restore sys.stdin
# restore sys.stdout
# restore sys.stderr
# cleanup __main__
# cleanup[1] encodings
# cleanup[1] site
# cleanup[1] abc
# cleanup[1] _codecs
# cleanup[1] _warnings
# cleanup[1] zipimport
# cleanup[1] encodings.utf_8
# cleanup[1] codecs
# cleanup[1] signal
# cleanup[1] posix
# cleanup[1] encodings.aliases
# cleanup[1] exceptions
# cleanup[2] copy_reg
# cleanup[2] posixpath
# cleanup[2] errno
# cleanup[2] _abcoll
# cleanup[2] types
# cleanup[2] genericpath
# cleanup[2] stat
# cleanup[2] warnings
# cleanup[2] UserDict
# cleanup[2] os.path
# cleanup[2] linecache
# cleanup[2] os
# cleanup sys
# cleanup __builtin__
# cleanup ints: 18 unfreed ints
# cleanup floats
[{WIFEXITED(s) && WEXITSTATUS(s) == 1}], 0, NULL) = 3009
--- SIGCHLD (Child exited) @ 0 (0) ---
read(10, "", 8192)                      = 0
exit_group(1)                           = ?
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T08:39:13+00:00Added an answer on May 29, 2026 at 8:39 am

    To test that my diagnosis (below) is correct, you could try running

    /usr/bin/python ./RunScriptPython.py
    

    (It should work.)


    Notice this in the output you posted:

    import site # precompiled from /usr/local/lib/python2.6/site.pyc
    

    The imports are looking in /usr/local/lib/python2.6. This is not the Ubuntu system’s default version of python. This is a local installation.

    When you install the python-lxml package, it is installed in /usr/lib/python2.6/, and is accessible with the Ubuntu system default version of python found in /usr/bin, instead of the /usr/local/bin version of python you seem to be running.

    Unless you need the /usr/local version of python for some reason, the easiest solution would be to uninstall it and use the /usr/bin version of python.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am following this tutorial and I've run the command ruby script\server and successfully
I'd like to run a script that does some evaluation of user-entered data after
I have a Ruby script that I built in TextMate and can successfully run
I have a shell script that I can run successfully from the command line.
I have a python script which uses subprocess.Popen to run multiple instances of another
How do I have a script run every, say 30 minutes? I assume there
Is it possible to have a Perl script run shell aliases? I am running
Can anyone please tell me how do I make this script run in IE
I run script/generate model query edit query.rb in models.. class Query < ActiveRecord::Base #I
I need a script to run on Vista Ultimate to share an external drive

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.