Embedding/Extending Python at the same time...

Discussion in 'Python' started by Hugh Macdonald, Nov 19, 2004.

  1. 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
     
    Hugh Macdonald, Nov 19, 2004
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Luke
    Replies:
    3
    Views:
    519
    Robin Becker
    Oct 24, 2003
  2. Faheem Mitha
    Replies:
    0
    Views:
    422
    Faheem Mitha
    Jun 28, 2004
  3. Alicia Haumann

    Extending/Embedding python

    Alicia Haumann, Sep 2, 2004, in forum: Python
    Replies:
    4
    Views:
    1,241
    Rick Ratzel
    Sep 9, 2004
  4. stefan
    Replies:
    3
    Views:
    439
    stefan
    Dec 8, 2004
  5. Tommy Nordgren
    Replies:
    2
    Views:
    332
    Mike Meyer
    Apr 21, 2005
Loading...

Share This Page