Question

So I have to run some python scripts on a cluster with machines for which I have no admin rights. Since numpy was missing, on some of the machines, I created a virtual environment and installed numpy there. I connected to a machine from which I knew it has no python and started the virtualenv python interpreter by ~my_env/bin/python to check for import numpy.

I got this error:

# Some trace...
ImportError: liblapack.so.3: File was not found # or something similar.

So I made some research on the internet and somebody came up with LD_LIBRARY_PATH. So I added

LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/me/lib; export LD_LIBRARY_PATH

to my .bashrc and sourced it. And I put liblapack.so.3 into /home/me/lib;. Now when I try to import numpy I get the error message:

ImportError: liblapack.so.3: wrong ELF class: ELFCLASS32

Now I am stuck. Any ideas what could have went wrong?

The cluster machines have Suse installed on them.

Was it helpful?

Solution

The error means that the format of the liblapack.so.3 C library differs from the binary format of Python itself. The usual cause for this particular error is having a 64-bit Python but a C library that is 32-bit. You need to have Python and the C library be compiled in the same way.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top