[gdal-dev] Re: Compiling GDAL with Python bindings - some help required

Howard Butler hobu.inc at gmail.com
Thu Sep 22 09:17:59 EDT 2011


On Sep 21, 2011, at 4:17 PM, NJ Duncan wrote:

> Dear Howard,
> 
> I'm trying to install GDAL with Python bindings on a university machine - no root access.  I can specify an installation directory using ./configure --prefix=/home/gdal and I assume one for python using --with-pymoddir=/home/gdalpy
> 
> This works ok, I then make and make install then get hit with the following:
> 
> make[2]: Entering directory `/home/s0091681/gdal-1.8.1/swig/python'
> python setup.py install
> running install
> error: can't create or remove files in install directory
> 
> The following error occurred while trying to add or remove files in the
> installation directory:
> 
>    [Errno 13] Permission denied: '/usr/lib64/python2.6/site-packages/test-easy-install-2736.write-test'
> 
> I've taken a look at setup.py and can't really see what I can change to specify the correct installation directory.
> 
> Any help would be really appreciated.
> 
> Best regards
> 
> Niall
> 

Niall,

$ ./configure --without-python --prefix=/path/to/my/home {other config options}
$ make 
$ make install

After doing that,

$ cd swig/python
$ python setup.py bdist_egg

Copy the .egg file in dist/ and to the location you wish, and then reference that in either your PYTHONPATH or easy_install .pth file (search web for details on this).  The --with-python of ./configure, which is the default, assumes it is able to install the GDAL python bindings globally.  This is often not the case, and they must be manually installed by building the .egg file and placing it where required and using PYTHONPATH to activate it in scenarios that do not have root access.

These types of questions are best asked on the email list, and I have taken the liberty of cc'ing this email there to the benefit of others in the future.

Howard



More information about the gdal-dev mailing list