Need help with extension modules built in debug mode

bhood2 at bhood2 at
Tue Aug 26 06:11:10 CEST 2008

I've come to the conclusion that posting about Embedded Python on the
Python forums is a complete waste of time.  I hope I can get some
useful insights here.

I'm looking for some help with extension modules built using Visual
Studio. I'm using the simple extension module example "hello" (taken
from the "Programming Python" book). I'm building it successfully in
both release and debug mode using a Visual Studio project.

I can successfully import the release build of the module into the
release build of Python.  For example:

    Python 2.5 (r25:51908, Sep 19 2006, 09:52:17) [MSC v.1310 32 bit
(Intel)] on win
    Type "help", "copyright", "credits" or "license" for more
    >>> import hello
    >>> hello.message("Bob")
    'Hello, Bob'
    >>> quit()

I cannot, however, load the debug build of the exact same code (stored
in the exact same location) into the debug build of Python:

    Python 2.5.1 (r251:54863, Jun  5 2007, 10:17:28) [MSC v.1400 32
bit (Intel)] on
    Type "help", "copyright", "credits" or "license" for more
    >>> import hello
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
    ImportError: No module named hello
    [26848 refs]
    >>> quit()
    [7826 refs]

Does anybody know what tricks or coding magic might be required to get
debug extension modules to load into debug Python?

More information about the Python-list mailing list