tonyibm
tonyibm

Reputation: 651

ImportError: /home/dminstalluser/script/lib/prctl.so: cannot open shared object file: No such file or directory

I am trying to run a python script, and seems when it try to import a library called prctl.so, some error happens:

def update_cmd_title():
    """Remove the secure informations in the command title"""
    sys.path.insert(0, os.path.dirname(os.path.realpath(__file__)) + "/script/lb")
    import prctl
    prctl.setprocname(" ".join(sys.argv))

but I can find this file prctl.so in directory /home/dminstalluser/script/lib/,

-rwxr-xr-x 1 dminstalluser dm_group 10344 Aug  1 03:55 prctl.so

I search from google, and can find somebody had the same problem, but after i followed their solutions, they all failed, like:

export LD_LIBRARY_PATH=/home/dminstalluser/script/lib

or run:

ldconfig

I don't know what's the problem for this error for my case,

Upvotes: 0

Views: 80

Answers (1)

Employed Russian
Employed Russian

Reputation: 213877

On a 64-bit system, the error is most likely caused by a mismatch between the Python you are running, and prctl.so that you've installed.

For example, trying to load 64-bit prctl.so into a 32-bit Python, or vice versa, will produce the error you've observed.

Run file $(which python) /home/dminstalluser/script/lib/prctl.so. If one of them says ELF 64-bit ..., and the other ELF 32-bit ..., then that's exactly your problem.

The fix is to install prctl.so matching your python.

Upvotes: 2

Related Questions