[gdal-dev] How to add GDAL as a dependency to a Python package?

Jason Roberts jason.roberts at duke.edu
Tue Apr 12 06:34:02 PDT 2016


Luís,

gdal-dev is the correct list. By “they”, I mean the maintainers of GDAL’s Python bindings; AFAIK they all follow gdal-dev.

Best,
Jason

From: Luí­s de Sousa [mailto:luis.de.sousa at protonmail.ch]
Sent: Tuesday, April 12, 2016 9:30 AM
To: Jason Roberts <jason.roberts at duke.edu>; gdal-dev at lists.osgeo.org
Subject: RE: [gdal-dev] How to add GDAL as a dependency to a Python package?

Thanks for the reply Jason.

I gather "they" refers to whomever I need to contact about this issue. Who are "they" then?

Luís

Sent from ProtonMail<https://protonmail.ch>, encrypted email based in Switzerland.


-------- Original Message --------
Subject: RE: [gdal-dev] How to add GDAL as a dependency to a Python package?
Local Time: April 12, 2016 3:25 PM
UTC Time: April 12, 2016 1:25 PM
From: jason.roberts at duke.edu<mailto:jason.roberts at duke.edu>
To: luis.de.sousa at protonmail.ch<mailto:luis.de.sousa at protonmail.ch>


Thanks for asking this. I have been wondering about it for a while but have not gotten around to asking it. I’m not sure they currently have a good solution for this for all platforms.

Jason


From: gdal-dev [mailto:gdal-dev-bounces at lists.osgeo.org] On Behalf Of Luí­s de Sousa
Sent: Tuesday, April 12, 2016 9:14 AM
To: gdal-dev at lists.osgeo.org<mailto:gdal-dev at lists.osgeo.org>
Subject: [gdal-dev] How to add GDAL as a dependency to a Python package?

Dear all,


I am trying to package a Python script that uses GDAL for PyPI. I started by including a direct reference in my setup.py:

install_requires=['GDAL==1.11.2'],

This way the package failed to install in my test virtual environment:

extensions/gdal_wrap.cpp:2855:22: fatal error: cpl_port.h: No such file or directory

#include "cpl_port.h"

                      ^

compilation terminated.

error: Setup script exited with error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

I then tried it with a reference to pygdal, since it is marked as a virtualenv friendly version:

install_requires=['pygdal'],

This way the installation finishes without errors (but with the usual load of compilation warnings). However, when then I invoke the script I get this error back:

Traceback (most recent call last):

  File "/home/desouslu/.virtualenvs/test_p3/bin/hasc2gml", line 5, in <module>

    from pkg_resources import load_entry_point

  File "/home/desouslu/.virtualenvs/test_p3/lib/python3.4/site-packages/pkg_resources.py", line 2716, in <module>

    working_set.require(__requires__)

  File "/home/desouslu/.virtualenvs/test_p3/lib/python3.4/site-packages/pkg_resources.py", line 685, in require

    needed = self.resolve(parse_requirements(requirements))

  File "/home/desouslu/.virtualenvs/test_p3/lib/python3.4/site-packages/pkg_resources.py", line 588, in resolve

    raise DistributionNotFound(req)

pkg_resources.DistributionNotFound: pygdal

What is the correct way of setting GDAL as a dependency?
Thank you,

Luís

Sent from ProtonMail<https://protonmail.ch>, encrypted email based in Switzerland.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20160412/f3931de9/attachment-0001.html>


More information about the gdal-dev mailing list