unable to import win32api into an embedded python interpreter.

pjd pjdurai at hotmail.com
Tue Oct 8 19:28:59 EDT 2002


> > I have embedded python 22 in a c++ program. Everything works as
expected, I
> > am able to execute external scripts.
> > But when I do an 'import win32api' in the script I am trying to execute,
it
> > barfs.
> > The same script works fine when executed from prompt as 'python
> > myscript.exe'.
> >
> > I am able to import other modules in my embedded interpreter. e.g.
'from
> > xml.dom import minidom'

> What exception do you get?

Here is the output of my script

Debugging  Server.
Adding parser accelerators ...
Done.
Traceback (most recent call last):
  File "c:\pingxcs.py", line 3, in ?
    import win32api
ImportError: No module named win32api

I am using PyRun_SimpleFile to run pingxcs.py from my Executable.

> win32apimodule.pyd depends on pywintypes22.dll - is that on your PATH?
> (Not PYTHONPATH but, system PATH)

I did find this dll in C:\winnt\system32

thanks
pj









More information about the Python-list mailing list