C Embedding problem, ImportError

Tero Pihlajakoski tepihlaj at paju.oulu.fi
Wed Feb 11 15:05:29 CET 2004


Anand K Rayudu <anand at easi.soft.net> wrote:
> [-- text/plain, encoding 7bit, charset: us-ascii, 49 lines --]

>  hi Tero,

> I also faced similar kind of problem on HP & IBM workstations.
> This is how i solved.

> run python outside & do following.
> It gives out the link options required for that platform, just 
> re-compile your application with those options.

> more information you can find out in python documentation chapter 


>  5.6 Linking Requirements

> in my downloaded documentation it is at ~/python-docs-2.3/ext/link-reqs.html

>>>> import distutils.sysconfig
>>>> distutils.sysconfig.get_config_var('LINKFORSHARED')
> '-Xlinker -export-dynamic'

> Hope this helps!! :-)

> Anand

Hey,

Yes, I checked out that script in the past, and it gave the same options I
was using (though I don't need -export-dynamic for the linker at the
moment, and adding it doesn't fix the problem).

However, I've traced the problem to the fact that I'm using Python from a
JNI module. If I compile the same JNI module with a "main" function, and
try importing math, it actually works. I'm very puzzled. It probably has
something to do with Java and JNI.

So: Anyone using Python scripting from a JNI C library, with scripts using
..../lib-dynload libs such as math? How did you get it to work?

- Tero

-- 




More information about the Python-list mailing list