Importing a custom module from a custom-built Python fails
Question: I've a weird problem. I'm setting up a project with an embedded Python
interpreter. I've rebuilt Python from the sources (3.3.2) and then copied the
Python libs as well as the .DLL into my application redistribution folder.

The weird stuff is that, while I'm being able to import a .py module, my
recompiled interpreter fails to import a .pyd custom-built file. The same file
imports file launching the interpreter from a Python regular distribution.

This is my code:

    
    
    Py_SetPythonHome((wchar_t *)wideBasePath.c_str());
    Py_InitializeEx(0);
    PyRun_SimpleString("import MClientAPI");
    

It fails stating _unable to find MClientAPI_ , while I have a _MClientAPI.pyd
file available. I've tried to move it either under site-packages, libs or the
root folder with no difference.

Any advice?


Answer: Well I discovered that, if you want to import a pyd file and you're in debug
mode, no matter what you type, Python will always look for a _d postfixed
file, in my case MClientAPI_d.pyd

