Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
$ mkdir virtualenvs
$ cd virtualenvs
$ virtualenv-2.6 --no-site-packages --python=/usr/local/python27/bin/python python27_paul
$ . ~/virtualenvs/python27_paul/bin/activate
(python27)$ deactivate
$ 

...

Code Block
$ . ~/virtualenvs/python27/bin/activate
$  cd /usr/local/src/gdal-1.8.1/
# assume you have already: wget, configure, make
$ make install
$ (python27)$ pip install --no-install GDAL==1.8.1
$ vim ~/virtualenvs/python27_paul/build/GDAL/setup.py
# replace
#   extra_link_args = []
# with 
#   extra_link_args = ['-Wl,-R/home/dev/virtualenvs/python27_paul/lib']

$ cd virtualenvs/python27_paul/build/GDAL

(python27)$ python setup.py build_ext --gdal-config=gdal-config \
              --library-dirs=/home/dev/virtualenvs/python27_paul/lib --include-dirs=/home/dev/virtualenvs/python27_paul/include

# OR

(python27)$ python setup.py build_ext --gdal-config=gdal-config --library-dirs=/home/dev/virtualenvs/python27/lib \
              --include-dirs=/home/dev/virtualenvs/python27/include install

### GETTING ERRORS HERE

# confirm linked library is correct
$ ldd /home/dev/virtualenvs/python27/lib/python2.7/site-packages/GDAL-1.8.1-py2.7-linux-x86_64.egg/osgeo/_gdal.so
...
# should be pointing to the correct version of the libs
...
$ (python27)$python 
Python 2.7.3 (default, May  9 2012, 14:28:18) [GCC 4.1.2 20080704 (Red Hat 4.1.2-48)] ...
>>> import gdal
>>> 

...