Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Embedding/Extending Python at the same time...

Reply
Thread Tools

Embedding/Extending Python at the same time...

 
 
Hugh Macdonald
Guest
Posts: n/a
 
      11-19-2004
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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Prevent two users from accessing the same file at the same time Shawn ASP .Net 2 02-19-2006 03:11 AM
how to use same user control x number of times on same asp page David Hubbard ASP .Net 2 01-12-2006 03:56 PM
Local LAN Access - Works for WinXP, No Go For Linux - Same Server,Same Laptop Marc Schwartz Cisco 0 06-18-2005 02:28 PM
Any problems with writing the information into a file - Multi-users perform writing the same file at the same time ???? HNguyen ASP .Net 4 12-21-2004 01:53 PM
Two PIX on same subnet with same gateway? This Old Man Cisco 4 10-20-2003 07:27 PM



Advertisments