Hi all (but particularly Bob)
I just installed Py2App with the installer, but when I tried to use it I got:
Traceback (most recent call last): File "setup.py", line 21, in ? import py2app File "/purelib/py2app/py2app/__init__.py", line 33, in ? File "/purelib/py2app/py2app/install.py", line 15, in ? File "/purelib/py2app/py2app/command/__init__.py", line 1, in ? File "/purelib/py2app/py2app/build_app.py", line 20, in ? File "/purelib/py2app/modulegraph/find_modules.py", line 21, in ? File "/purelib/py2app/modulegraph/modulegraph.py", line 15, in ? ImportError: No module named ObjectGraph
My first question was:
"where the heck is /purelib ?"
After some poking around, I found that indeed, there is no module objectgraph in:
/Library/Python/2.3/altgraph/
which is version "0.6.1"
but there is one in:
/Library/Python/2.3/py2app/altgraph
which is version "0.6.3"
As I'd never heard of altgraph before, I'm guessing that the older version was installed by a previous version of Py2App, and Py2app now puts it in a different place, and the older one is being found first. To test this, I removed the older one, and then got:
Traceback (most recent call last): File "./setup.py", line 10, in ? import py2app File "/purelib/py2app/py2app/__init__.py", line 33, in ? File "/purelib/py2app/py2app/install.py", line 15, in ? File "/purelib/py2app/py2app/command/__init__.py", line 1, in ? File "/purelib/py2app/py2app/build_app.py", line 25, in ? ImportError: No module named MachOGraph
So I then deleted everything outside of /Users that had py2app in it. Then re-installed py2app. Running it again, I got the same error:
ImportError: No module named MachOGraph
Looking in the source, I see that MachOGraph.py is in src/macholib, but in my python installation macholib is in both
/Library/Python/2.3/ and /Library/Python/2.3/py2app/
just like altgraph.
lather, rinse repeat, and BINGO! it works.
So, am I right that those older versions of altgraph and macholib were installed by an older Py2app?
If so, some sort of waring should be put in about that.
Also, while it's probably a good idea that you're now putting those packages inside the Py2app directory, it would probably be better to load them as:
from Py2app.macholib import MachOGraph
So that you know you're getting the version you installed for Py2app.
By the way, if I needed altgraph for something else, I'd now be kind of screwed. Tome, this supports the argument I've been making for versioning. If we had a standard approach for versioning python packages, you could have the Py2app installer install the version of altgraph (and whatever else) it needs, and not screw up an exiting installation that other folk's code might be depending on.
-Chris
PS: Now that it works, it works fabulously! My simple wxPython app built with the very simplest of setup.py files, except for wxversion, which I'm going to go read Bob's changes in the Wiki, and figure out how to do that. Nice job.
-- Christopher Barker, Ph.D. Oceanographer NOAA/OR&R/HAZMAT (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception
[EMAIL PROTECTED] _______________________________________________ Pythonmac-SIG maillist - Pythonmac-SIG@python.org http://mail.python.org/mailman/listinfo/pythonmac-sig