[Pythonmac-SIG] py2app and ipython
Thomas Robitaille
thomas.robitaille at gmail.com
Thu Apr 30 22:36:52 CEST 2009
>> I am trying to use py2app to make a simple MacOS X application that
>> launches an ipython shell.
>
> How do you expect to use this? It appears to need a terminal window
> -- Py2app is usually for GUI apps, so it will dump output to
> Console.app, but not give you a terminal.
That's true - what I would really like is to be able to open a
terminal with an ipython prompt from a .app file, and to include a
specific module I am developing so that it can be used from that
prompt. All this in a bundled file so that any user can download it
and use it without installing python. I've poked around a bit and have
found this
http://svn.pythonmac.org/py2app/py2app/trunk/examples/EggInstaller/EggInstaller.py
which looks like what I need for opening the terminal. But the problem
is that when the terminal is opened, the script that is run uses the
system python, not the one in the .app file, so if there is no system
python, this will crash. I guess maybe a solution is that when the
terminal is opened I should be setting the $PYTHONPATH to the path
inside the .app file? Any ideas?
>> However, when I try launching the resulting executable, I get a
>> dialog with "ImportError: No module named ipy_profile_none"
>
> where does that usually live?
>
> For more diagnostics you can look into the build app bundle by right
> clicking on the bundle. Poke around in there, and you can see what's
> getting included.
I looked into this some more. I actually had a problem even if my
python module is a single line, for example
import custommodule
where custommodule is a module I wrote myself and installed using
easy_install or python setup.py install. If I use such a module,
the .app gives an ImportError...
> You may need to explicitly include the IPython pacakge, so you'll
> get eveything. See a recent thread: py2app and mysqldb
>
>> What am I missing?
>> Not sure if this is important, but when running setup.py py2app, I
>> get the following warning:
>> /usr/bin/strip: the __LINKEDIT segment does not cover the end of
>> the file (can't be processed) in: /Users/tom/Code/python/
>> experimental/ipython/test/dist/aplpy.app/Contents/Frameworks/
>> libgcc_s.1.dylib (for architecture i386)
>
> You may need the latest macholib:
>
> easy_install macholib==dev
Thanks!
Thomas
> -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
More information about the Pythonmac-SIG
mailing list