1

I have GDAL installed on Webfaction wight the following commands:

$ mkdir src
$ cd scr
$ svn checkout https://svn.osgeo.org/gdal/branches/1.10/gdal gdal
$ cd gdal
$ ./configure --with-python=/usr/local/bin/python2.7 
$ make
$ make install

Now if I try to import GDAL I get the following error:

>>> from osgeo import gdal
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/ustroetz/lib/python2.7/GDAL-1.10.1-py2.7-linux-x86_64.egg/osgeo/__init__.py", line 21, in <module>
    _gdal = swig_import_helper()
  File "/home/ustroetz/lib/python2.7/GDAL-1.10.1-py2.7-linux-x86_64.egg/osgeo/__init__.py", line 17, in swig_import_helper
    _mod = imp.load_module('_gdal', fp, pathname, description)
ImportError: /home/ustroetz/lib/python2.7/GDAL-1.10.1-py2.7-linux-x86_64.egg/osgeo/_gdal.so: undefined symbol: GDALUseTransformer

However if cd to liband try it there it works just fine:

>>> from osgeo import gdal
>>> 

What do I have to set in order to use it from anywhere within Webfaction?

My lib folder contains the following:

$ ls
gdalplugins  libgdal.la  libgdal.so.1       python2.4  python2.7
libgdal.a    libgdal.so  libgdal.so.1.17.1  python2.5
ustroetz
  • 5,802
  • 16
  • 47
  • 74

1 Answers1

1

I got it to work with the following:

  1. Open your ~/.bashrc. You do this by typing in the command line:

    $ vi ~/.bashrc

  2. Add to ~/.bashrc the following:

    export LD_LIBRARY_PATH=/home/your username/lib

  3. Close and save with

    :x

  4. Restart the terminal.

ustroetz
  • 5,802
  • 16
  • 47
  • 74