[python-win32] Problems embedding in C++

Mark Hammond mhammond@skippinet.com.au
Wed, 17 Jul 2002 19:40:37 +1000


Do any non-Win32 .pyd files import?  If so, my guess is that a dependent DLL
can not be found.  Is pywintypesxx.dll on your PATH (not PYTHONPATH)?

Re "-v" for embedded Python - set Py_VerboseFlag from your C++ code.

Mark.

> -----Original Message-----
> From: python-win32-admin@python.org
> [mailto:python-win32-admin@python.org]On Behalf Of Ishank Jain
> Sent: Wednesday, 17 July 2002 3:47 AM
> To: python-win32@python.org
> Subject: [python-win32] Problems embedding in C++
>
>
> Hi,
>
> I have been trying to run a simple python file from C++ using the
> PyRun_SimpleFile C api call.
>
> Let the file I need to run be demo.py.
> If the demo.py contains simple python commands such as:
>
> print "Hello World"
>
> my program works fine. But when i try to use something like:
>
> import win32com
> print "Hello World"
>
> it gives me an error saying that it cannot find the win32api module. i
> checked the sys.path and it has the required path entries.
>
> also if i run the demo.py file using the python win gui then it runs
> correctly. only when i run the file using the PyRun_SimpleFile call, it
> fails.
>
> here is the traceback of the error:
> -----------------------------
> Traceback (most recent call last):
>   File "..\hello.py", line 15, in ?
>     import win32com
>   File "C:\Python22\lib\site-packages\win32com\__init__.py", line 5, in ?
>     import win32api, sys
> ImportError: No module named win32api
> [3929 refs]
> -----------------------------
>
> any help would be appreciated.
>
> Ishank Jain
> -----------------------------------------------
> Graduate Student
> Computer Engeering
> University of Minnesota, Twin Cities
> Voice: (Res) 612-331-9696 (Off) 612-626-0276
> Email: ishank_jain@hotmail.com
> -----------------------------------------------
>
> _________________________________________________________________
> Send and receive Hotmail on your mobile device: http://mobile.msn.com
>
>
>
> _______________________________________________
> Python-win32 mailing list
> Python-win32@python.org
> http://mail.python.org/mailman/listinfo/python-win32