Problems with OS X 10.5.6 and Python 2.5 and GDAL 1.6

Ned Deily nad at acm.org
Thu Feb 19 19:51:46 CET 2009


In article <F71B1E4C-87A5-41DD-AA9A-92687223F0DB at ucsd.edu>,
 "Helly John J." <hellyj at ucsd.edu> wrote:
> I installed the 2.5.4 binary from the python.org site.  I did this  
> because NumPy and SciPy currently only work with 2.5 and the system  
> version was 2.4.
>[...]
> On Feb 16, 2009, at 8:35 PM, Helly John J. wrote:
> > I'm a newbie to python and am running:
> > OS X 10.5.6
> > Python 2.5.4
>[...]
> > and have run easy_install for gdal like this:
> >
> > /Library/Python/2.5/site-packages>sudo easy_install GDAL
> > Password:
> > Searching for GDAL
> > Best match: GDAL 1.6.0
> > Processing GDAL-1.6.0-py2.5-macosx-10.5-i386.egg
> > GDAL 1.6.0 is already the active version in easy-install.pth
> >
> > Using /Library/Python/2.5/site-packages/GDAL-1.6.0-py2.5-macosx-10.5- 
> > i386.egg
> > Processing dependencies for GDAL
> > Finished processing dependencies for GDAL
> >
> > However, when I run python and try to import gdal, this is what  
> > happens:
> >
> > Python 2.5.4 (r254:67917, Dec 23 2008, 14:57:27)
> > [GCC 4.0.1 (Apple Computer, Inc. build 5363)] on darwin
> > Type "help", "copyright", "credits" or "license" for more information.
> > >>> import gdal
> > Traceback (most recent call last):
> > File "<stdin>", line 1, in <module>
> > ImportError: No module named gdal
> > >>>

It looks like you have installed GDAL to the site-packages directory of 
the Apple-supplied python 2.5 (which, for 10.5, is 2.5.1, not 2.4).  
That site-packages directory is /Library/Python/2.5. The Apple-supplied 
python comes with a sym link from /usr/bin/python.  If you launch it, 
you'll probably find GDAL is there as expected.

If you do want to use the python.org python, which is somewhat newer, 
you need to install its own version of setuptools/easy_install and use 
it to install GDAL to the site-packages directory of that python which 
is located here:
/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-pack
ages.  The two python instances co-exist.  To install another 
easy_install, ensure the python.org python come first first on your 
PATH, then follow the instructions here:
   <http://pypi.python.org/pypi/setuptools>

-- 
 Ned Deily,
 nad at acm.org




More information about the Python-list mailing list