C extension modules in Python

L

luiscasanova

Hello,

I'vre written an extension module to accelarate some code i've made in
python with numarray. Then i compiled an linke d it with swig, my
problem is that when i make the import in my python code it gives me an
error: ImportError: libnumarray.so: cannot open shared object file: No
such file or directory

does anyone know why this hapens and how can i solve it?
 
A

Alex Martelli

Hello,

I'vre written an extension module to accelarate some code i've made in
python with numarray. Then i compiled an linke d it with swig, my
problem is that when i make the import in my python code it gives me an
error: ImportError: libnumarray.so: cannot open shared object file: No
such file or directory

does anyone know why this hapens and how can i solve it?

It seems that the libnumarray.so (which your extension is probably
trying to load) is not in a directory where your system will like
loading it from. It's hard to say more without knowing about your
system, and the way you've set things up for it in terms of loading of
dynamic libraries (which IS a very system-dependent thing).


Alex
 
R

Robert Kern

Hello,

I'vre written an extension module to accelarate some code i've made in
python with numarray. Then i compiled an linke d it with swig, my
problem is that when i make the import in my python code it gives me an
error: ImportError: libnumarray.so: cannot open shared object file: No
such file or directory

does anyone know why this hapens and how can i solve it?

Are you using distutils to compile and link your extension? You should be.

Are you trying to directly link against libnumarray.so (i.e. by passing
the "-lnumarray" option to the linker)? You shouldn't be.

--
Robert Kern
(e-mail address removed)

"In the fields of hell where the grass grows high
Are the graves of dreams allowed to die."
-- Richard Harter
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,981
Messages
2,570,188
Members
46,732
Latest member
ArronPalin

Latest Threads

Top