I can load Python modules (.py, .pyc, .pyd) from a zip file by calling "import some_module" from the Python interpreter only after the sys.path has been expanded to include the zip file and only after I run
import zipextimporter zipextimporter.install()
The latter is required for .pyd modules.
I can also load Python.py and .pyc modules from Python embedded in C ++. However, to also load .pyd modules from embedded Python, I added
PyRun_SimpleString("import zipextimporter");
C ++ exe goes beyond this line without errors. But the next team
PyRun_SimpleString("zipextimporter.install()");
gives me this error:

Why does zipextimporter.install () fail when inserting Python?
How can i solve this?
Perhaps this is due to how C ++ code compiles? I am using g ++:
g++ embed-simple.cpp -IE:\Python27\include -LE:\Python27\libs -lpython27 -o embed-simple
I saw the link How to link to msvcr90.dll with mingw gcc?
Could this provide a solution? If so, how do I configure it, gcc β g ++, since I am running the code in C ++, not C.
I am running Python 2.7.2 on WinXP.
I am not getting a runtime error after a clean install of Python 2.7.2, only this:
Import error: no module named ....
Will it matter how the C ++ script attachment is compiled? I used g ++. I also compiled using the Intel compiler, but it gave the same runtime error. Maybe I should try MS Visual C ++.
Or use ctypes to import pyd?