[Pythonmac-SIG] What does it take to run a GUI app?

Chris Barker chris.barker at noaa.gov
Wed Aug 27 18:54:37 CEST 2014


On Mon, Aug 25, 2014 at 8:32 AM, Aaron Meurer <aaron.meurer at continuum.io>
wrote:

> > you can. but you sure don't want to from the start of your development
>  > process. And there are hybrid command-line GuI apps like iPython or
> anything
> > that wants to pop up, say, a matplotlib graph. So we do need a command
> line
> > python that can run a GUI.
>
> Yes, matplotlib is big here. The default backend on OS X uses a Cocoa
> GUI, which is almost completely broken if not run with a framework
> build (see https://github.com/matplotlib/matplotlib/issues/665).
>
> However, I just tested both Anaconda pythonw and the python.org python
> (both 3.4), and neither work directly with matplotlib. Both require
> you to start IPython and type %matplotlib or the plot will not show.


That's standard iPython -- it has to do with event loops capturing (or not)
the REPL. Nothing to so with the issue at hand. YOu can also start up
iPython with this turned on (ipython --pylab, I think)

> well Anaconda would need to be able to re-locate, that's kind of the point
> > -- so probably why they didn't just grab that build to begin with. Not
> that
> > they couldn't make a re-locatable Framework. But problem at hand is about
> > the app bundle and start up executable, not the Framework anyway.
>
> Yes, relocatability is essential. Conda can make path replacements in
> plain text files at install time, but in general it's best if
> everything uses relative paths.


hence the avoidance of a Framework -- though _maybe_ one could build a
re-locatable framework.


> The app bundle seems to work just as well as the framework.  If
> something explicitly looks for WITH_NEXT_FRAMEWORK it fill fail
> (although we could probably forcibly set that to 1 if it helps).


yup -- these are orthogonal -- for the GUI issue you need the app bundle.
So the trick at hand is how to re-direct an executable in a "normal"
location to the one in the app bundle. While Ned may be right that there
could be a better way to do it, the short bit of code (pythonw.c) in the
python source has been working well for years -- seem worth giving it a
shot with Anaconda.

As for a Framework build, one advantage it would give is keeping the python
lib dir cleanly separated from the rest of the Anaconda lib dir (this has
caused problems for me, anyway). There are other ways to do that anyway, if
you choose to do so.

-Chris



-- 

Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R            (206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115       (206) 526-6317   main reception

Chris.Barker at noaa.gov
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/pythonmac-sig/attachments/20140827/2b822804/attachment.html>


More information about the Pythonmac-SIG mailing list