Problems with OS X 10.5.6 and Python 2.5 and GDAL 1.6

Helly John J. hellyj at ucsd.edu
Thu Feb 19 22:07:57 EST 2009


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-CCDF68DF3269 at ucsd.edu>,
"Helly John J." <hellyj at 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,
nad at acm.org

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




More information about the Python-list mailing list