Re: [Pythonmac-SIG] py2app: Bombing on unknown load command 27

2009-01-05 Thread Joel Gluck

Thanks, Chris -- very clear and useful guidance!
I will roll up my sleeves and get into this as soon as time allows...
-- Joel

On Jan 5, 2009, at 12:08 PM, Christopher Barker wrote:


Joel Gluck wrote:
Question: when I ran easy_install for py2app as you suggested, it  
returned an error:


Well, I'm not setuptools expert, but I notice the following:


*Joel-Glucks-iMac:~ joel$ easy_install py2app==dev*


...


*(Currently using setuptools 0.6c7


so in this case, setuptools 0.6c7 is begin used.

...


*setuptools 0.6c9 is already the active version in easy-install.pth*


But now setuptools itself thinks it's already 0.6c9, so it hasn't  
updated anything.


...



*Installing easy_install script to /Users/joel/bin*
*Installing easy_install-2.5 script to /Users/joel/bin*


here setuptools has put the easy_install script in your home dir,  
rather than the default script directory. For instance, easy_install  
is here:


/Library/Frameworks/Python.framework/Versions/Current/bin/easy_install

on my system. typing "which easy_install" may help you figure out  
what's getting used.


So:

I suspect you are having issues with multiple different copies of  
setuptools and/or python.


I'd make sure that you are using the python you think you are.

You might also want to clean out setuptools and re-installs -- I  
don't know of any way to do this automatically, but you can delete  
stuff from site-packages and ALSO from easy_install.pth


Take a look at how PATH is being set also:

echo $PATH

and look in your .bash_profile or wherever your shell PATH is being  
added to, so that's it's set up right for you.


-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.bar...@noaa.gov



___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig


Re: [Pythonmac-SIG] py2app: Bombing on unknown load command 27

2009-01-05 Thread Ned Deily
In article <49623e92.3070...@noaa.gov>,
 Christopher Barker  wrote:
> Joel Gluck wrote:
> > Question: when I ran easy_install for py2app as you suggested, it 
> > returned an error:
> 
> Well, I'm not setuptools expert, but I notice the following:
> 
> > *Joel-Glucks-iMac:~ joel$ easy_install py2app==dev*
> 
> ...
> 
> > *(Currently using setuptools 0.6c7 
> 
> so in this case, setuptools 0.6c7 is begin used.
> 
> ...
> 
> > *setuptools 0.6c9 is already the active version in easy-install.pth*
> 
> But now setuptools itself thinks it's already 0.6c9, so it hasn't 
> updated anything.

This appears to be another instance of being bitten by the Apple Leopard 
Python sys.path misfeature.  In short, the Apple-supplied Python for 
10.5 ships with the older version of setuptools and, because of the 
order of directories on its sys.path, the older version is always found 
first.

Jack suggests a workaround in this thread:



So you could try putting a .pth hack for the newer setuptools into one 
of the directories on sys.path as he suggests.

-- 
 Ned Deily,
 n...@acm.org

___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig


[Pythonmac-SIG] Bus error with Python 2.5.4

2009-01-05 Thread Russell E. Owen
I'm seeing a bus error on MacOS X 10.5.6 when using Python 2.5.4 to 
display images via PIL and Tkinter. Before I try to track down the 
details I'm wondering if anyone else has already seen and diagnosed it.

-- Russell

___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig


Re: [Pythonmac-SIG] py2app: Bombing on unknown load command 27

2009-01-05 Thread Christopher Barker

Joel Gluck wrote:
Question: when I ran easy_install for py2app as you suggested, it 
returned an error:


Well, I'm not setuptools expert, but I notice the following:


*Joel-Glucks-iMac:~ joel$ easy_install py2app==dev*


...

*(Currently using setuptools 0.6c7 


so in this case, setuptools 0.6c7 is begin used.

...


*setuptools 0.6c9 is already the active version in easy-install.pth*


But now setuptools itself thinks it's already 0.6c9, so it hasn't 
updated anything.


...



*Installing easy_install script to /Users/joel/bin*
*Installing easy_install-2.5 script to /Users/joel/bin*


here setuptools has put the easy_install script in your home dir, rather 
than the default script directory. For instance, easy_install is here:


/Library/Frameworks/Python.framework/Versions/Current/bin/easy_install

on my system. typing "which easy_install" may help you figure out what's 
getting used.


So:

I suspect you are having issues with multiple different copies of 
setuptools and/or python.


I'd make sure that you are using the python you think you are.

You might also want to clean out setuptools and re-installs -- I don't 
know of any way to do this automatically, but you can delete stuff from 
site-packages and ALSO from easy_install.pth


Take a look at how PATH is being set also:

echo $PATH

and look in your .bash_profile or wherever your shell PATH is being 
added to, so that's it's set up right for you.


-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.bar...@noaa.gov
___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig


Re: [Pythonmac-SIG] Bus error with Python 2.5.4

2009-01-05 Thread Russell E. Owen
In article ,
 "Russell E. Owen"  wrote:

> I'm seeing a bus error on MacOS X 10.5.6 when using Python 2.5.4 to 
> display images via PIL and Tkinter. Before I try to track down the 
> details I'm wondering if anyone else has already seen and diagnosed it.

I should add that this problem is new in 2.5.4; it does not occur in 
2.5.2. Also, I've seen it on two machines. (It's in a big application 
and I've not had time to track it down yet; for now I've just reverted 
to 2.5.2).

-- Russell

___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig


Re: [Pythonmac-SIG] py2app: Bombing on unknown load command 27

2009-01-05 Thread Christopher Barker

Joel Gluck wrote:

Hi Chris,

One more related question on this -- when I run my setup script, the 
following 4 eggs appear in my cwd:


*altgraph-0.6.7-py2.5.egg*
*modulegraph-0.7-py2.5.egg*
*bdist_mpkg-0.4.3-py2.5.egg*
*macholib-1.1-py2.5.egg*

Why is this happening?


those are the py2app dependencies -- why in the world you'd get them in 
your cwd is beyond me.


When you say "my setup script" -- do you mean your setup.py that is 
supposed to build your app?


post it, and we'll see if there is anything weird about it.


Is it safe to have my script just delete these when I'm done?


I would think so, but I don't know why they are there at all.


-CHB

--
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.bar...@noaa.gov
___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig


Re: [Pythonmac-SIG] py2app: Bombing on unknown load command 27

2009-01-05 Thread Joel Gluck


Chris, here's the setup script (which I run in my cwd, containing the  
main program I'm creating an app out of, "savi.py"). TIA for your  
diagnosis, doc! -- Joel


import os
from setuptools import setup

print os.system(r'sudo rm -rf mac_build mac_dist savi_log.txt') 

APP = ['savi.py']
DATA_FILES = ['../gameplay', 'data', 'en']
OPTIONS = { 'argv_emulation': True,
"iconfile": "icons/mac_savi_icon.icns",
"dist_dir":"mac_dist",
"bdist_base":"mac_build",
 		"frameworks": ["SDL_image.framework", "SDL_ttf.framework",  
"SDL_mixer.framework", "SDL.framework"],

"includes":["Numeric"]  }

setup(  app=APP,
data_files=DATA_FILES,
options={'py2app': OPTIONS},
setup_requires=['py2app'],
version="0.2.3" )

print os.system(r'sudo rm -rf mac_dist/savi.app/Contents/Frameworks/ 
*.*')
print os.system(r'sudo cp -R mac_frameworks/*.* mac_dist/savi.app/ 
Contents/Frameworks')


A Couple of Notes on the Above:

1) The py2app "frameworks" option doesn't work for multiple items,  
which is why I end up copying the frameworks into the app manually at  
the end -- I keep a copy of them in a special folder...)


2) This script always bombs in setup() -- here's the error:
File "build/bdist.macosx-10.3-i386/egg/macholib/MachO.py", line 178,  
in load

raise ValueError("Unknown load command: %d" % (cmd_load.cmd,))
ValueError: Unknown load command: 27
> /Users/joel/Documents/OT Video Games/SAVI Learning Tool Prototype  
ver 2.3/build/bdist.macosx-10.3-i386/egg/macholib/MachO.py(178)load()
Perhaps it never gets to delete the eggs because it bombs? Although I  
do tell Pdb to "cont" and it seems to exit normally... -- Joel





On Jan 5, 2009, at 6:14 PM, Christopher Barker wrote:


Joel Gluck wrote:

Hi Chris,
One more related question on this -- when I run my setup script,  
the following 4 eggs appear in my cwd:

*altgraph-0.6.7-py2.5.egg*
*modulegraph-0.7-py2.5.egg*
*bdist_mpkg-0.4.3-py2.5.egg*
*macholib-1.1-py2.5.egg*
Why is this happening?


those are the py2app dependencies -- why in the world you'd get them  
in your cwd is beyond me.


When you say "my setup script" -- do you mean your setup.py that is  
supposed to build your app?


post it, and we'll see if there is anything weird about it.


Is it safe to have my script just delete these when I'm done?


I would think so, but I don't know why they are there at all.


-CHB

--
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.bar...@noaa.gov


___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig


Re: [Pythonmac-SIG] py2app: Bombing on unknown load command 27

2009-01-05 Thread Christopher Barker

Joel Gluck wrote:
Chris, here's the setup script (which I run in my cwd, containing the 
main program I'm creating an app out of, "savi.py"). TIA for your 
diagnosis, doc! -- Joel*


that all looks pretty normal.

oh, you do run it as:

$python setup.py py2app

don't you?

One note:

One more related question on this -- when I run my setup script, the 
following 4 eggs appear in my cwd:

*altgraph-0.6.7-py2.5.egg*
*modulegraph-0.7-py2.5.egg*
*bdist_mpkg-0.4.3-py2.5.egg*
*macholib-1.1-py2.5.egg*


I still have no idea why those eggs get into you dir, but I'm running 
macholib 1.2:


>>> import macholib
>>> macholib.__version__
'1.2'

so it looks like you haven't succeeded in fully upgrading py2app and all 
its dependencies.


The mackolib upgrade may help your unknown load command error.


-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.bar...@noaa.gov
___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig