[gdal-dev] can't import osgeo or gdal in python

Christopher Barker Chris.Barker at noaa.gov
Mon Sep 20 13:33:39 EDT 2010


Jeff Hamann wrote:
> Chris, 
> 
> Thanks for responding to my post. 

re-including the gdal list -- I suspect you didn't mean to reply only to me.

> I'm not using the pre-built frameworks as I'm trying to construct a 
> stack that can be "easily" built, installed, and replicated on Linux, 
> FreeBSD (my fav), windows (not so much) and OSX.

In that case, I'd forget about the framework build -- you might as well 
keep it as similar to the other *nix's

If you're not trying to do frameworks, and you don't need to 
re-distribute to other architectures or OS-X versions, it should be a 
pretty straightforward build.

One issue to look for: there are a lot of python versions available for 
the Mac: Apple's, the python.org one, fink, macports, build-your-own, ...

so make sure you know what version you are using, and that you are doing 
everything with that same version.


>>>  When I try to "run" (again newbie
>>> talking here, so be patient), a python script and import gdal:

>>> /Library/Python/2.6/site-packages/GDAL-1.7.2-py2.6-macosx-10.6-universal.egg/osgeo/_gdal.so
>>>  Expected in: flat namespace

This is something I know next to nothign abuot, but I know there is 
something in OS-X with things being build with either "flat" or "nested" 
namespaces -- perhaps those have gotten confused with your build? Did 
you build your own Python?

Not much, sorry.

-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.Barker at noaa.gov


More information about the gdal-dev mailing list