Hi folks,<br><br>I&#39;m trying to use the GDAL library as part of a Python application I need to run.  Specifically, there&#39;s an open source project that no longer runs on Lion, and I&#39;ve been updating a few settings to try and re-build the standalone application for OS X users.  The application depends on GDAL Python.<br>
<br>The problem I run into is the &quot;flat namespace&quot; error: <br><br>File &quot;/Library/Python/2.7/site-packages/GDAL-1.7.1-py2.7-macosx-10.7-intel.egg/osgeo/__init__.py&quot;, line 21, in &lt;module&gt;<br>    _gdal = swig_import_helper()<br>
  File &quot;/Library/Python/2.7/site-packages/GDAL-1.7.1-py2.7-macosx-10.7-intel.egg/osgeo/__init__.py&quot;, line 17, in swig_import_helper<br>    _mod = imp.load_module(&#39;_gdal&#39;, fp, pathname, description)<br>ImportError: dlopen(/Library/Python/2.7/site-packages/GDAL-1.7.1-py2.7-macosx-10.7-intel.egg/osgeo/_gdal.so, 2): Symbol not found: _CPLDefaultErrorHandler<br>
  Referenced from: /Library/Python/2.7/site-packages/GDAL-1.7.1-py2.7-macosx-10.7-intel.egg/osgeo/_gdal.so<br>  Expected in: flat namespace<br> in /Library/Python/2.7/site-packages/GDAL-1.7.1-py2.7-macosx-10.7-intel.egg/osgeo/_gdal.so<br>
<br>Some research tells me that this is a common issue with Python package management on OS X.  I&#39;ve found a previous message about this on the list - <a href="http://lists.osgeo.org/pipermail/gdal-dev/2010-September/026051.html">http://lists.osgeo.org/pipermail/gdal-dev/2010-September/026051.html</a> - but it&#39;s an explanation for the issue rather than a way to resolve it.<br>
<br>Unfortunately, all I know about Python package management is what I&#39;ve learned trying to run setup.py to build the OS X standalone, so I don&#39;t have a clue how to resolve the import error.<br><br>The version of GDAL listed in the error message above is the only one I have installed on my machine; I suspected a MacPorts problem and cleaned out my library paths.  If I delete the GDAL library from the path listed in the error message, Python no longer finds any GDAL at all.  Doing a clean reinstall from the GDAL 1.7.1 release recreates the same library, flat namespace error and all.  So it&#39;s not an issue with conflicting libraries.<br>
<br>Because I&#39;m trying to use the GDAL library as part of Python code written by someone else and which is only somewhat maintained for OS X, it&#39;s possible that the way it imports GDAL is the problem - if the code worked on the original author&#39;s machine but not mine.  But all I have there is the line &quot;from osgeo import gdal&quot;, which should work as far as I can tell from the documentation.<br>
<br>Any suggestions?<br><br>Thanks,<br>Evan James<br>