[Distutils] How to add GDAL as a dependency to a Python package

Chris Barker chris.barker at noaa.gov
Wed Apr 13 14:31:52 EDT 2016

On Wed, Apr 13, 2016 at 12:02 AM, Luí­s de Sousa <
luis.de.sousa at protonmail.ch> wrote:

> Thank you for the reply Chris.
> I just tried to install pygdal directly from PiPY on a stock Ubuntu
> distribution and it fails [0], even if I supposedly have all the necessary
> headers installed.

I took a quick look, and it looks like the buld/install failed on numpy --
numpy is a dependency of gdal. so you may want to get numpy installed first.

(that surprises me -- I thought numpy built out of the box pretty easily --
if not with an optimized BLAS) and it looks like it did build, but somehow
failed to install....

anyway, this is all why Anaconda and Canopy exist...


> I will try easier ways before going with Conda, but thanks for the
> suggestion in any case.
> Luís
> [0] http://pastebin.com/gzrimLvB
> *Sent from ProtonMail <https://protonmail.ch>, encrypted email based in
> Switzerland.*
> -------- Original Message --------
> Subject: Re: [Distutils] How to add GDAL as a dependency to a Python
> package
> Local Time: April 12, 2016 6:45 PM
> UTC Time: April 12, 2016 4:45 PM
> From: chris.barker at noaa.gov
> To: luis.de.sousa at protonmail.ch
> CC: distutils-sig at python.org
> setting gdal as a dependency is only going to work if one of these is true:
> * There is a binary wheel on PyPi for gdal (which is very hard to do,
> though with teh manylinux effort, maybe there will be some day)
> * the system on which you are trying to install is all set up to compile
> gdal -- which is a major effort, and indeed, I'm not sure is possible (I
> haven't looked)
>   - The GDAL source ships with the python bindings, so the usual thing is
> for gdal itself and the pyton bindings to all get compiled and installed at
> once. I"m not srue that anyone has made a setup.py that will do that.
> This kind of thing is exactly why conda exists -- python packages with
> complex non-python dependencies are not well handled by pip / pypi -- if I
> were you, I"d give it a try :-)
> -CHB


Christopher Barker, Ph.D.

Emergency Response Division
NOAA/NOS/OR&R            (206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115       (206) 526-6317   main reception

Chris.Barker at noaa.gov
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/distutils-sig/attachments/20160413/b3788f0e/attachment.html>

More information about the Distutils-SIG mailing list