[gdal-dev] Python bindings

Roger André randre at gmail.com
Sat Oct 17 16:42:47 EDT 2009


Had a similar problem in the past that I resolved like this:

$ gdalinfo --formats
gdalinfo: error while loading shared libraries: libgdal.so.1: cannot
open shared object file: No such file or directory

--> Is the lib acessible outside of gdal?
$ /sbin/ldconfig -p | grep gdal

-->nuffin...  Let's try adding the path to libgdal.so.1 in /etc/ld.so.conf

$ find /usr -name libgdal.so.1
/usr/local/lib/libgdal.so.1

$ sudo vi /etc/ld.so.conf
--> add
/usr/local/lib

$ ldconfig

$ /sbin/ldconfig -p | grep gdal
	libgdal.so.1 (libc6) => /usr/local/lib/libgdal.so.1
	libgdal.so (libc6) => /usr/local/lib/libgdal.so
---------------------------

On Sat, Oct 10, 2009 at 5:44 AM, Chaitanya kumar CH
<chaitanya.ch at gmail.com> wrote:
> Hi,
>
> I am having trouble running GDAL's Python bindings. I compiled the trunk
> with the option --with-python. Below is some output from my command line. I
> am running this on a newly installed system. It has only 2.6 version of
> Python and python-setuptools.
>
> ----------------------------------
> ubuntu at ubuntu:~/gdal/2270/trunk/gdal$ export PYTHONPATH=/usr/local/
> ubuntu at ubuntu:~/gdal/2270/trunk/gdal$ python
> Python 2.6.2 (release26-maint, Apr 19 2009, 01:58:18)
> [GCC 4.3.3] 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/local/lib/python2.6/dist-packages/GDAL-1.6.0-py2.6-linux-x86_64.egg/osgeo/__init__.py",
> line 4, in <module>
>    import _gdal
> ImportError: libgdal.so.1: cannot open shared object file: No such file or
> directory
>>>> import gdal
> Traceback (most recent call last):
>  File "<stdin>", line 1, in <module>
>  File
> "/usr/local/lib/python2.6/dist-packages/GDAL-1.6.0-py2.6-linux-x86_64.egg/gdal.py",
> line 2, in <module>
>    from osgeo.gdal import deprecation_warn
>  File
> "/usr/local/lib/python2.6/dist-packages/GDAL-1.6.0-py2.6-linux-x86_64.egg/osgeo/__init__.py",
> line 4, in <module>
>    import _gdal
> ImportError: libgdal.so.1: cannot open shared object file: No such file or
> directory
>>>>
> ubuntu at ubuntu:~/gdal/2270/trunk/gdal$ ls /usr/local/lib/
> libgdal.a  libgdal.la  libgdal.so  libgdal.so.1  libgdal.so.1.13.0
> python2.6
> ubuntu at ubuntu:~/gdal/2270/trunk/gdal$
> ----------------------------------
>
> Thank you.
> --
> Chaitanya kumar CH.
>
>
> _______________________________________________
> gdal-dev mailing list
> gdal-dev at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/gdal-dev
>


More information about the gdal-dev mailing list