Fatal Python error with Py_InitModule (Python 2.3)

Discussion in 'Python' started by Andrew Ellem, Aug 25, 2003.

  1. Andrew Ellem

    Andrew Ellem Guest

    I'm using Python embedded in my app, and I've run into problems creating my
    own
    modules. I'm using Python version 2.3 compiled with MSVC .NET (not 2003).

    When I call Py_InitModule I get the message:
    "Fatal Python error: Interpreter not initialized (version mismatch?)"

    However, Python does seem to be initialized. Py_IsInitialized() returns 1,
    and I
    can PyImport_Import() and I can run scripts successfully from my program.

    I'm not sure what I could be doing wrong, all the information I've found
    online
    indicates that the above message comes from incompatible version (not using
    a
    debug version, etc), but I don't see how that would be the problem in my
    case,
    since I can run normal scripts.

    Does anyone have an idea what might be the problem?

    Thanks.

    _________________________________________________________________
    Protect your PC - get McAfee.com VirusScan Online
    http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963
    Andrew Ellem, Aug 25, 2003
    #1
    1. Advertising

  2. Andrew Ellem

    John Paquin Guest

    this problem is almost certainly because the headers you compiled with
    do not match the dll that's getting loaded. My advice to you is to
    download the source tar, unzip it, build it (from dist\pcbuild) and use
    that dll and those header files. Then you'll know that everything matches.

    Andrew Ellem wrote:
    > I'm using Python embedded in my app, and I've run into problems creating
    > my own
    > modules. I'm using Python version 2.3 compiled with MSVC .NET (not 2003).
    >
    > When I call Py_InitModule I get the message:
    > "Fatal Python error: Interpreter not initialized (version mismatch?)"
    >
    > However, Python does seem to be initialized. Py_IsInitialized() returns
    > 1, and I
    > can PyImport_Import() and I can run scripts successfully from my program.
    >
    > I'm not sure what I could be doing wrong, all the information I've found
    > online
    > indicates that the above message comes from incompatible version (not
    > using a
    > debug version, etc), but I don't see how that would be the problem in my
    > case,
    > since I can run normal scripts.
    >
    > Does anyone have an idea what might be the problem?
    >
    > Thanks.
    >
    > _________________________________________________________________
    > Protect your PC - get McAfee.com VirusScan Online
    > http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963
    >
    >
    John Paquin, Aug 27, 2003
    #2
    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. anton
    Replies:
    0
    Views:
    322
    anton
    Jun 2, 2005
  2. mmacrobert
    Replies:
    1
    Views:
    412
    Thomas Heller
    Aug 31, 2007
  3. Laszlo Nagy
    Replies:
    0
    Views:
    323
    Laszlo Nagy
    Jan 12, 2009
  4. Replies:
    1
    Views:
    731
  5. Replies:
    1
    Views:
    411
Loading...

Share This Page