Python in C integration and WxPython

David Wilson dw-google.com at botanicus.net
Thu Sep 15 07:57:31 EDT 2005


It sounds like your C program and Python script are running under
different interpreters. Your C program almost certainly is using a
Python version that comes with Cygwin, while the script is probably
using a native win32 Python that has wxPython installed.

Assuming this is true, then compiling your C program natively on
Windows should solve the problem. Alternatively, if wxPython is
available for cygwin (possibly via cygwin's X server) then installing
it would also help.


David.


Alain Paschoud wrote:
> Hi all,
>
> I made a small dialog in WxPython. I can run the python script with a
> double-click or through command line, and everything goes fine (dialog
> appears, which means that wx module has been found).
> Then, I decided to write a C program (under Windows, with Cygwin) that
> will read my script (through PyRun_SimpleFile() function) and run it.
> But the system doesn't find the wx module to import...
>
> Traceback (most recent call last):
>   File "Dialog.py", line 2, in ?
>     import  wx
> ImportError: No module named wx
>
> How can I say to my program where to search for this module ? I tried to
> set $PYTHONPATH and $PYTHONHOME, but this doesn't change anything.
>
> More generally : Does a C program that embedded python run an external
> executable (interpreter), or does it only load libraries ?
> 
> Thank you very much for any help on this topic.
> 
> Best regards.




More information about the Python-list mailing list