Adding /usr/local/lib to PYTHONPATH won't help much since python knowns where the GDAL python module but can't find the GDAL library itself.

Is /usr/local/lib in the linker path? You may want to check /etc/ld.so.conf to see if /usr/local/lib is in there. If not, add /usr/local/lib to /etc/ld.so.conf and then run ldconfig. BUT, this may not be the best solution as you are running a 64-bit linux system.

Since it looks like you compiled your own GDAL, you should reconfigure and recompile GDAL with something like:

./configure --libdir=/usr/local/lib64 OTHER_CONFIG_FLAGS

Reconfiguring and recompiling GDAL should work as I'm guessing that /usr/local/lib64 is in /etc/ld.so.conf but /usr/local/lib isn't.

-bborie

On 08/24/2011 03:54 PM, Andrea Peri wrote:
Are you able to load the GDAL python module through python?  Try the
following in python:

from osgeo import gdal

If the above doesn't work, the GDAL python module may not be located in
any of the default module paths expected by python.  You may need to
specify the environmental variable PYTHONPATH to include the path to the
GDAL python module.

-bborie


Hi,
Thx for you help.

I try your test.

it give this error.

Python 2.6.6 (r266:84292, Apr 11 2011, 15:50:32)
[GCC 4.4.4 20100726 (Red Hat 4.4.4-13)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
from osgeo import gdal
Traceback (most recent call last):
   File "<stdin>", line 1, in<module>
   File
"/usr/lib64/python2.6/site-packages/GDAL-1.9.0-py2.6-linux-x86_64.egg/osgeo/__init__.py",
line 21, in<module>
     _gdal = swig_import_helper()
   File
"/usr/lib64/python2.6/site-packages/GDAL-1.9.0-py2.6-linux-x86_64.egg/osgeo/__init__.py",
line 17, in swig_import_helper
     _mod = imp.load_module('_gdal', fp, pathname, description)
ImportError: libgdal.so.1: cannot open shared object file: No such file or
directory


It seem not find the libgdal.so.1

I check it is available in the "/usr/local/lib" path
so as you suggest, I set
export PYTHONPATH=/usr/local/lib
but the error is again here.

Python 2.6.6 (r266:84292, Apr 11 2011, 15:50:32)
[GCC 4.4.4 20100726 (Red Hat 4.4.4-13)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
from osgeo import gdal
Traceback (most recent call last):
   File "<stdin>", line 1, in<module>
   File
"/usr/lib64/python2.6/site-packages/GDAL-1.9.0-py2.6-linux-x86_64.egg/osgeo/__init__.py",
line 21, in<module>
     _gdal = swig_import_helper()
   File
"/usr/lib64/python2.6/site-packages/GDAL-1.9.0-py2.6-linux-x86_64.egg/osgeo/__init__.py",
line 17, in swig_import_helper
     _mod = imp.load_module('_gdal', fp, pathname, description)
ImportError: libgdal.so.1: cannot open shared object file: No such file or
directory





_______________________________________________
postgis-users mailing list
[email protected]
http://postgis.refractions.net/mailman/listinfo/postgis-users

--
Bborie Park
Programmer
Center for Vectorborne Diseases
UC Davis
530-752-8380
[email protected]
_______________________________________________
postgis-users mailing list
[email protected]
http://postgis.refractions.net/mailman/listinfo/postgis-users

Reply via email to