> I'm getting crasy about embedding python-win32 in a c++ application.
> 
> PyRun_SimpleString("import win32api") failes with the error message:
> 
> ImportError: No module named win32api.

Try setting the "verbose" flag (I can't recall how to spell that via the C
API) and you should end up with info about the paths being searched - that
will help to determine if it is a simple sys.path issue.  If that seems
correct, try starting with 'import pywintypes' - win32api depends on
pywintypesxx.dll - but in general, failure to locate the missing DLL will
result in an error dialog before the import error, and as you didn't mention
that, I'm guessing you didn't see it.

Any serious embedding will want a debug version of Python and pywin32
anyway, so the other alternative is to trace through the execution in a
debug build - eg, set a break-point at an approproate place inside the
import machinery.  You will need to build python and pywin32 from source to
do that, but its not that hard once you have the compiler installed.

Good luck,

Mark

_______________________________________________
python-win32 mailing list
python-win32@python.org
http://mail.python.org/mailman/listinfo/python-win32

Reply via email to