Hi folks,<br><br>I'm trying to use the GDAL library as part of a Python application I need to run. Specifically, there's an open source project that no longer runs on Lion, and I'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 "flat namespace" error: <br><br>File "/Library/Python/2.7/site-packages/GDAL-1.7.1-py2.7-macosx-10.7-intel.egg/osgeo/__init__.py", line 21, in <module><br> _gdal = swig_import_helper()<br>
File "/Library/Python/2.7/site-packages/GDAL-1.7.1-py2.7-macosx-10.7-intel.egg/osgeo/__init__.py", line 17, in swig_import_helper<br> _mod = imp.load_module('_gdal', 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'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'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've learned trying to run setup.py to build the OS X standalone, so I don'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's not an issue with conflicting libraries.<br>
<br>Because I'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's possible that the way it imports GDAL is the problem - if the code worked on the original author's machine but not mine. But all I have there is the line "from osgeo import gdal", which should work as far as I can tell from the documentation.<br>
<br>Any suggestions?<br><br>Thanks,<br>Evan James<br>