[wxPython] Trouble on Mac OS X (Jaguar)

Last night I downloaded wxPythosOSX and MachoPython binaries to my iBook
running Jaguar (Mac OS X 10.2.1). I was able to install them
successfully. However, there are two problems. I'm not sure if these
are Jaguar related, or if I've just screwed something up.

1) When I run the Python application in Applications, it starts, then
immediately exits. No window is ever drawn
2) When I attempt to run wxPython code that I developed on my Linux
workstation, the GUI displays properly, however, no menu bar appears,
and I can't actually *use* it. That is, the window is drawn, but I
can't interact with it at all.

Is this a known issue / common problem? Any assistance would be
appreciated.

Nathan R. Yergler

···

--
------------------------------------------------------
Nathan R. Yergler
nathan at yergler dot net

Public Key available at http://yergler.net/~nathan
------------------------------------------------------

Hi Nathan,

Last night I downloaded wxPythosOSX and MachoPython binaries to my iBook
running Jaguar (Mac OS X 10.2.1). I was able to install them
successfully. However, there are two problems. I'm not sure if these
are Jaguar related, or if I've just screwed something up.

1) When I run the Python application in Applications, it starts, then
immediately exits. No window is ever drawn

At the moment, this is the correct behavior. Python.app is basically a utility to run scripts, and since it did not receive a script, it simply exited. If you drop a script on it, it will run it. BTW, if you are looking for a Python IDE, it can be found in /Library/Frameworks/Python.Framework/Versions/2.2/Mac/Tools/IDE/PythonIDE.
py

In the future, I think that PythonMac will open the IDE by default.

2) When I attempt to run wxPython code that I developed on my Linux
workstation, the GUI displays properly, however, no menu bar appears,
and I can't actually *use* it. That is, the window is drawn, but I
can't interact with it at all.

Are you running the script via the terminal? There has been some confusion because Jaguar includes its own version of python (in /usr/bin), and this is the Python that runs when you type python from the terminal. Jaguar's Python does not completely work with GUI scripts. (It's a long story, one you can read up on by checking the wxPythonMac archives if you're interested! =)

If you used the terminal to start the script, try double-clicking on the script in the finder and see if it loads properly. (or use /usr/local/bin/pythonw) I've got Jaguar 10.2.1 on my home machine, and it runs wxPythonOSX fine, so I'm not sure what could be going wrong.

If you did double-click on it and are still having problems, could you open up the Console (/Applications/Utilities/Console.app) and see if it is giving any error messages?

Kevin

···

On Monday, October 14, 2002, at 06:42 AM, Nathan R. Yergler wrote:

Is this a known issue / common problem? Any assistance would be
appreciated.

Nathan R. Yergler

--
------------------------------------------------------
Nathan R. Yergler
nathan at yergler dot net

Public Key available at http://yergler.net/~nathan
------------------------------------------------------

_______________________________________________
wxpython-users mailing list
wxpython-users@lists.wxwindows.org
http://lists.wxwindows.org/mailman/listinfo/wxpython-users

OK, that makes sense in regards to the Python.app. I guess I was
expecting IDLE, or something similar; I'll look where you recommended.

In regards to running programs, I was running them from the terminal,
but explicitly specifying the python binary; ie,
$/usr/local/bin/python testwx.py

After posting this morning I decided to try a simple wxPython app
instead of the code I'm porting. Long story short, I was able to make
it work when double-clicking it's source file, but not from the
terminal. I think I need to go and do some more looking at things to
figure out exactly what's going on. When running a wx app from the
terminal, is it better to use pythonw instead of python? I guess I'm
not clear on the difference. Thanks for your help!

Nathan

···

On Mon, 2002-10-14 at 10:13, Kevin Ollivier wrote:

Hi Nathan,

On Monday, October 14, 2002, at 06:42 AM, Nathan R. Yergler wrote:

> Last night I downloaded wxPythosOSX and MachoPython binaries to my iBook
> running Jaguar (Mac OS X 10.2.1). I was able to install them
> successfully. However, there are two problems. I'm not sure if these
> are Jaguar related, or if I've just screwed something up.
>
> 1) When I run the Python application in Applications, it starts, then
> immediately exits. No window is ever drawn

At the moment, this is the correct behavior. Python.app is basically a
utility to run scripts, and since it did not receive a script, it simply
exited. If you drop a script on it, it will run it. BTW, if you are
looking for a Python IDE, it can be found in
/Library/Frameworks/Python.Framework/Versions/2.2/Mac/Tools/IDE/PythonIDE.
py

In the future, I think that PythonMac will open the IDE by default.

> 2) When I attempt to run wxPython code that I developed on my Linux
> workstation, the GUI displays properly, however, no menu bar appears,
> and I can't actually *use* it. That is, the window is drawn, but I
> can't interact with it at all.
>

Are you running the script via the terminal? There has been some
confusion because Jaguar includes its own version of python (in
/usr/bin), and this is the Python that runs when you type python from
the terminal. Jaguar's Python does not completely work with GUI scripts.
(It's a long story, one you can read up on by checking the wxPythonMac
archives if you're interested! =)

If you used the terminal to start the script, try double-clicking on the
script in the finder and see if it loads properly. (or use
/usr/local/bin/pythonw) I've got Jaguar 10.2.1 on my home machine, and
it runs wxPythonOSX fine, so I'm not sure what could be going wrong.

If you did double-click on it and are still having problems, could you
open up the Console (/Applications/Utilities/Console.app) and see if it
is giving any error messages?

Kevin

> Is this a known issue / common problem? Any assistance would be
> appreciated.
>
> Nathan R. Yergler
>
>
> --
> ------------------------------------------------------
> Nathan R. Yergler
> nathan at yergler dot net
>
> Public Key available at http://yergler.net/~nathan
> ------------------------------------------------------
>
>
> _______________________________________________
> wxpython-users mailing list
> wxpython-users@lists.wxwindows.org
> http://lists.wxwindows.org/mailman/listinfo/wxpython-users
>

_______________________________________________
wxpython-users mailing list
wxpython-users@lists.wxwindows.org
http://lists.wxwindows.org/mailman/listinfo/wxpython-users

--
------------------------------------------------------
Nathan R. Yergler
nathan at yergler dot net

Public Key available at http://yergler.net/~nathan
------------------------------------------------------

OK, that makes sense in regards to the Python.app. I guess I was
expecting IDLE, or something similar; I'll look where you recommended.

In regards to running programs, I was running them from the terminal,
but explicitly specifying the python binary; ie,
$/usr/local/bin/python testwx.py

After posting this morning I decided to try a simple wxPython app
instead of the code I'm porting. Long story short, I was able to make
it work when double-clicking it's source file, but not from the
terminal. I think I need to go and do some more looking at things to
figure out exactly what's going on. When running a wx app from the
terminal, is it better to use pythonw instead of python? I guess I'm
not clear on the difference. Thanks for your help!

The reason for the different versions is that OS X handles GUI windows/applications differently than Windows or Linux. In order for Python to run GUI scripts like wxPython, Python itself must initialize the GUI. Otherwise, menus and other bits do not properly initialize, as you've noticed. (The reasons why are not completely understood - OS X does some "magic" under the hood during initialization that is undocumented.) IIRC, pythonw is actually just a small script which passes the script on to Python.app for loading. So you can think of /usr/local/bin/python as CLI Python, and pythonw for launching wxPython scripts.

Kevin

···

On Monday, October 14, 2002, at 08:57 AM, Nathan R. Yergler wrote:

Nathan

On Mon, 2002-10-14 at 10:13, Kevin Ollivier wrote:

Hi Nathan,

On Monday, October 14, 2002, at 06:42 AM, Nathan R. Yergler wrote:

Last night I downloaded wxPythosOSX and MachoPython binaries to my iBook
running Jaguar (Mac OS X 10.2.1). I was able to install them
successfully. However, there are two problems. I'm not sure if these
are Jaguar related, or if I've just screwed something up.

1) When I run the Python application in Applications, it starts, then
immediately exits. No window is ever drawn

At the moment, this is the correct behavior. Python.app is basically a
utility to run scripts, and since it did not receive a script, it simply
exited. If you drop a script on it, it will run it. BTW, if you are
looking for a Python IDE, it can be found in
/Library/Frameworks/Python.Framework/Versions/2.2/Mac/Tools/IDE/PythonIDE.
py

In the future, I think that PythonMac will open the IDE by default.

2) When I attempt to run wxPython code that I developed on my Linux
workstation, the GUI displays properly, however, no menu bar appears,
and I can't actually *use* it. That is, the window is drawn, but I
can't interact with it at all.

Are you running the script via the terminal? There has been some
confusion because Jaguar includes its own version of python (in
/usr/bin), and this is the Python that runs when you type python from
the terminal. Jaguar's Python does not completely work with GUI scripts.
(It's a long story, one you can read up on by checking the wxPythonMac
archives if you're interested! =)

If you used the terminal to start the script, try double-clicking on the
script in the finder and see if it loads properly. (or use
/usr/local/bin/pythonw) I've got Jaguar 10.2.1 on my home machine, and
it runs wxPythonOSX fine, so I'm not sure what could be going wrong.

If you did double-click on it and are still having problems, could you
open up the Console (/Applications/Utilities/Console.app) and see if it
is giving any error messages?

Kevin

Is this a known issue / common problem? Any assistance would be
appreciated.

Nathan R. Yergler

--
------------------------------------------------------
Nathan R. Yergler
nathan at yergler dot net

Public Key available at http://yergler.net/~nathan
------------------------------------------------------

_______________________________________________
wxpython-users mailing list
wxpython-users@lists.wxwindows.org
http://lists.wxwindows.org/mailman/listinfo/wxpython-users

_______________________________________________
wxpython-users mailing list
wxpython-users@lists.wxwindows.org
http://lists.wxwindows.org/mailman/listinfo/wxpython-users

--
------------------------------------------------------
Nathan R. Yergler
nathan at yergler dot net

Public Key available at http://yergler.net/~nathan
------------------------------------------------------

_______________________________________________
wxpython-users mailing list
wxpython-users@lists.wxwindows.org
http://lists.wxwindows.org/mailman/listinfo/wxpython-users

Anyone using Fink (http://fink.sf.net/), and does that help/hinder
wxPython under Jaguar (or, I guess really under "Fink") in any way?

Kevin Cole wrote:

Anyone using Fink (http://fink.sf.net/), and does that help/hinder
wxPython under Jaguar (or, I guess really under "Fink") in any way?

We tried wxPython on Fink 0.4.1 with X-Darwin on Mac OS-X 10.1, and it worked just fine apart from a few window manager issues (moving/resizing/automatical raising of windows). If you are not bothered by the non-native look of the widgets or by the additional overhead of running an X server in addition to Aqua, this might be the way to go. For 10.2, however, you should wait for the new Fink 0.5 release, which is slated for October.

Oliver

···

---------------------
F. Oliver Gathmann, Ph.D.
Cenix BioScience GmbH
Pfotenhauer Strasse 108
D-01307 Dresden, Germany
phone: +49 (351) 210-2735
fax: +49 (351) 210-1309
--------------------------

OK, got it. And things are making sense. With one exception. My code
uses Python's XML parsing within a class. I was using xml.dom.minidom,
since my needs are minimal and it was the fastest to get up and going.
If I run python from the command-line, I'm able to import and parse xml
strings or files. If I run my program (using the same Python binary), I
get errors from SAX about 'no parsers available'. Any thoughts? Any
one? Any one? Thanks again for all your help.

Nathan

···

On Mon, 2002-10-14 at 12:21, Kevin Ollivier wrote:

On Monday, October 14, 2002, at 08:57 AM, Nathan R. Yergler wrote:

> OK, that makes sense in regards to the Python.app. I guess I was
> expecting IDLE, or something similar; I'll look where you recommended.
>
> In regards to running programs, I was running them from the terminal,
> but explicitly specifying the python binary; ie,
> $/usr/local/bin/python testwx.py
>
> After posting this morning I decided to try a simple wxPython app
> instead of the code I'm porting. Long story short, I was able to make
> it work when double-clicking it's source file, but not from the
> terminal. I think I need to go and do some more looking at things to
> figure out exactly what's going on. When running a wx app from the
> terminal, is it better to use pythonw instead of python? I guess I'm
> not clear on the difference. Thanks for your help!

The reason for the different versions is that OS X handles GUI
windows/applications differently than Windows or Linux. In order for
Python to run GUI scripts like wxPython, Python itself must initialize
the GUI. Otherwise, menus and other bits do not properly initialize, as
you've noticed. (The reasons why are not completely understood - OS X
does some "magic" under the hood during initialization that is
undocumented.) IIRC, pythonw is actually just a small script which
passes the script on to Python.app for loading. So you can think of
/usr/local/bin/python as CLI Python, and pythonw for launching wxPython
scripts.

Kevin

> Nathan
>
>
> On Mon, 2002-10-14 at 10:13, Kevin Ollivier wrote:
>> Hi Nathan,
>>
>> On Monday, October 14, 2002, at 06:42 AM, Nathan R. Yergler wrote:
>>
>>> Last night I downloaded wxPythosOSX and MachoPython binaries to my
>>> iBook
>>> running Jaguar (Mac OS X 10.2.1). I was able to install them
>>> successfully. However, there are two problems. I'm not sure if these
>>> are Jaguar related, or if I've just screwed something up.
>>>
>>> 1) When I run the Python application in Applications, it starts, then
>>> immediately exits. No window is ever drawn
>>
>> At the moment, this is the correct behavior. Python.app is basically a
>> utility to run scripts, and since it did not receive a script, it
>> simply
>> exited. If you drop a script on it, it will run it. BTW, if you are
>> looking for a Python IDE, it can be found in
>> /Library/Frameworks/Python.Framework/Versions/2.2/Mac/Tools/IDE/PythonIDE.
>> py
>>
>> In the future, I think that PythonMac will open the IDE by default.
>>
>>> 2) When I attempt to run wxPython code that I developed on my Linux
>>> workstation, the GUI displays properly, however, no menu bar appears,
>>> and I can't actually *use* it. That is, the window is drawn, but I
>>> can't interact with it at all.
>>>
>>
>> Are you running the script via the terminal? There has been some
>> confusion because Jaguar includes its own version of python (in
>> /usr/bin), and this is the Python that runs when you type python from
>> the terminal. Jaguar's Python does not completely work with GUI
>> scripts.
>> (It's a long story, one you can read up on by checking the wxPythonMac
>> archives if you're interested! =)
>>
>> If you used the terminal to start the script, try double-clicking on
>> the
>> script in the finder and see if it loads properly. (or use
>> /usr/local/bin/pythonw) I've got Jaguar 10.2.1 on my home machine, and
>> it runs wxPythonOSX fine, so I'm not sure what could be going wrong.
>>
>> If you did double-click on it and are still having problems, could you
>> open up the Console (/Applications/Utilities/Console.app) and see if it
>> is giving any error messages?
>>
>> Kevin
>>
>>> Is this a known issue / common problem? Any assistance would be
>>> appreciated.
>>>
>>> Nathan R. Yergler
>>>
>>>
>>> --
>>> ------------------------------------------------------
>>> Nathan R. Yergler
>>> nathan at yergler dot net
>>>
>>> Public Key available at http://yergler.net/~nathan
>>> ------------------------------------------------------
>>>
>>>
>>> _______________________________________________
>>> wxpython-users mailing list
>>> wxpython-users@lists.wxwindows.org
>>> http://lists.wxwindows.org/mailman/listinfo/wxpython-users
>>>
>>
>>
>> _______________________________________________
>> wxpython-users mailing list
>> wxpython-users@lists.wxwindows.org
>> http://lists.wxwindows.org/mailman/listinfo/wxpython-users
> --
> ------------------------------------------------------
> Nathan R. Yergler
> nathan at yergler dot net
>
> Public Key available at http://yergler.net/~nathan
> ------------------------------------------------------
>
>
> _______________________________________________
> wxpython-users mailing list
> wxpython-users@lists.wxwindows.org
> http://lists.wxwindows.org/mailman/listinfo/wxpython-users
>

_______________________________________________
wxpython-users mailing list
wxpython-users@lists.wxwindows.org
http://lists.wxwindows.org/mailman/listinfo/wxpython-users

--
------------------------------------------------------
Nathan R. Yergler
nathan at yergler dot net

Public Key available at http://yergler.net/~nathan
------------------------------------------------------

Nathan R. Yergler wrote:

OK, got it. And things are making sense. With one exception. My code
uses Python's XML parsing within a class. I was using xml.dom.minidom,
since my needs are minimal and it was the fastest to get up and going. If I run python from the command-line, I'm able to import and parse xml
strings or files. If I run my program (using the same Python binary), I
get errors from SAX about 'no parsers available'. Any thoughts? Any
one? Any one? Thanks again for all your help.

Are you _sure_ that it's the same Python? If you've installed my MachoPython binary then /usr/local/bin/python and /usr/local/bin/pythonw will end up using the same libs, (eventhough they are different binaries,) but the /usr/bin/python installed with Jaguar is a totally separate installation of Python with its own site-packages.

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!