Thanks, Ned. Despite the problems, your help has given me something to work with.
Cheers.
--------------
John Helly, University of California, San Diego
San Diego Supercomputer Center
Scripps Institution of Oceanography 9500 Gilman Dr. Mail Code, La Jolla CA 92093 Phone: Voice +01 760 840 8660 mobile / stonesteps (Skype) / stonesteps7 (iChat)
http://www.sdsc.edu/~hellyj



On Feb 19, 2009, at 7:02 PM, Ned Deily wrote:

In article <2fe1a73a-5bdd-45cd-8323-ccdf68df3...@ucsd.edu>,
"Helly John J." <hel...@ucsd.edu> wrote:
[...]
3.  I changed the gdal_merge.py code so it uses the correct syntax
even after the error but then find that I get the original 'no module'
error, I think, because gdal_merge.py starts with the line:

#!/usr/bin/env python

I don't understand this usage but when I run it alone (i.e., /usr/bin/
env) I see that it forces the PATH, and the environment in general, to
be something different than what I have set in my .bash_profile.  For
example, it puts

PATH=/Library/Frameworks/Python.framework/Versions/Current/bin:

in the beginning in front of /usr/bin which I had moved up in the path
in my .bash_profile.  I overcame this by getting rid of /usr/bin/env
and substituting /usr/bin/python.

See <http://en.wikipedia.org/wiki/Shebang_(Unix)>.

The idea behind /usr/bin/env usage is to allow scripts to get around
absolute paths and to be able to find the interpreter for the script by
using the search order of $PATH.  So, if the script with /usr/bin/env
python was invoking the wrong python, it sounds like your $PATH wasn't
really what you thought it was, despite changing your .bash_profile.
Did you start a new terminal session or login shell?  What does "echo
$PATH" say?

So, there are three issues:

1. the malloc error
2. the interaction with the gdal_merge.py error handling

No suggestions on the first two, other than to perhaps install
easy_install and GDAL and friends using the python.org 2.5 and/or to ask
in a more specialized forum.

Otherwise, everything's peachy.

Good luck!

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

--
http://mail.python.org/mailman/listinfo/python-list

--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to