468,103 Members | 1,251 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,103 developers. It's quick & easy.

Embedding/Extending Python at the same time...

I've got a slight problem... and I'm stuck as to where to go with it...

I'm running on Redhat7.2, using Python 2.2.2

I've got a compiled module that I wrote almost a year ago - it works fine, and I've never had any problems with it...

I also did an extension to a plugin (Shake) using Python, so the plugin loads a python module and calls various functions in there....

all in all, fine - I thought I had my head around the system, and there were no problems...

However, I've just hit a problem...

If, in my plugin code, I import a module that is pure python, I'm fine. However, if I import my own compiled module, then I start having problems....

Initially, the module was compiled without linking to the actual python library. When I run the plugin, it fails, and PyErr_Print() prints out:

Traceback (most recent call last):
File "/usr/people/hugh-m/dev/apps/hub/python/modules/noarch/hubdbremote.py", line 19, in ?
import hub
ImportError: /usr/people/hugh-m/dev/apps/hub/python/modules/linux.redhat7.2.i386/hub.so: undefined symbol: PyFloat_Type
If I modify the SConstruct file so that the module links to the python library, it gives the following error:

Fatal Python error: Interpreter not initialized (version mismatch?)

Any idea what I could do to get around either of these?

Should python modules be compiled with the library linked in?

The plugin is compiled with gcc3.2.1 (needed because it's a Shake plugin), and the module is compiled with gcc2.96 (because that is what Python needs it to be). Is this my issue? If so, how can I get around it?
Any suggestions most welcome... and apologies for the large number of questions..

Cheers

--
Hugh Macdonald
The Moving Picture Company
Jul 18 '05 #1
0 1347

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Alicia Haumann | last post: by
2 posts views Thread by Roose | last post: by
1 post views Thread by Tommy Nordgren | last post: by
3 posts views Thread by Marco Meoni | last post: by
1 post views Thread by jeremito | last post: by
3 posts views Thread by anonymisiert85 | last post: by
1 post views Thread by Solo | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.