<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Verdana;
panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
{font-family:Consolas;
panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman",serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
p
{mso-style-priority:99;
mso-margin-top-alt:auto;
margin-right:0in;
mso-margin-bottom-alt:auto;
margin-left:0in;
font-size:12.0pt;
font-family:"Times New Roman",serif;}
code
{mso-style-priority:99;
font-family:"Courier New";}
pre
{mso-style-priority:99;
mso-style-link:"HTML Preformatted Char";
margin:0in;
margin-bottom:.0001pt;
font-size:10.0pt;
font-family:"Courier New";}
p.msonormal0, li.msonormal0, div.msonormal0
{mso-style-name:msonormal;
mso-margin-top-alt:auto;
margin-right:0in;
mso-margin-bottom-alt:auto;
margin-left:0in;
font-size:12.0pt;
font-family:"Times New Roman",serif;}
span.colour
{mso-style-name:colour;}
span.font
{mso-style-name:font;}
span.size
{mso-style-name:size;}
span.HTMLPreformattedChar
{mso-style-name:"HTML Preformatted Char";
mso-style-priority:99;
mso-style-link:"HTML Preformatted";
font-family:Consolas;}
span.pln
{mso-style-name:pln;}
span.pun
{mso-style-name:pun;}
span.lit
{mso-style-name:lit;}
span.typ
{mso-style-name:typ;}
span.kwd
{mso-style-name:kwd;}
span.com
{mso-style-name:com;}
span.str
{mso-style-name:str;}
span.EmailStyle32
{mso-style-type:personal-reply;
font-family:"Verdana",sans-serif;
color:#1F497D;}
.MsoChpDefault
{mso-style-type:export-only;
font-family:"Calibri",sans-serif;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Verdana",sans-serif;color:#1F497D">Luís,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Verdana",sans-serif;color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Verdana",sans-serif;color:#1F497D">gdal-dev is the correct list. By “they”, I mean the maintainers of GDAL’s Python bindings; AFAIK they all follow gdal-dev.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Verdana",sans-serif;color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Verdana",sans-serif;color:#1F497D">Best,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Verdana",sans-serif;color:#1F497D">Jason<o:p></o:p></span></p>
<p class="MsoNormal"><a name="_MailEndCompose"><span style="font-size:10.0pt;font-family:"Verdana",sans-serif;color:#1F497D"><o:p> </o:p></span></a></p>
<span style="mso-bookmark:_MailEndCompose"></span>
<p class="MsoNormal"><b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">From:</span></b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"> Luís de Sousa [mailto:luis.de.sousa@protonmail.ch]
<br>
<b>Sent:</b> Tuesday, April 12, 2016 9:30 AM<br>
<b>To:</b> Jason Roberts <jason.roberts@duke.edu>; gdal-dev@lists.osgeo.org<br>
<b>Subject:</b> RE: [gdal-dev] How to add GDAL as a dependency to a Python package?<o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal">Thanks for the reply Jason. <o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">I gather "they" refers to whomever I need to contact about this issue. Who are "they" then?<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">Luís<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal"><i>Sent from <a href="https://protonmail.ch">ProtonMail</a>, encrypted email based in Switzerland.</i><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<div>
<p class="MsoNormal">-------- Original Message --------<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">Subject: RE: [gdal-dev] How to add GDAL as a dependency to a Python package?<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">Local Time: April 12, 2016 3:25 PM<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">UTC Time: April 12, 2016 1:25 PM<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">From: <a href="mailto:jason.roberts@duke.edu">jason.roberts@duke.edu</a><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">To: <a href="mailto:luis.de.sousa@protonmail.ch">luis.de.sousa@protonmail.ch</a><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span class="size"><span style="font-size:10.0pt;font-family:"Verdana",sans-serif;color:#1F497D">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.</span></span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span class="size"><span style="font-size:10.0pt;font-family:"Verdana",sans-serif;color:#1F497D"> </span></span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span class="size"><span style="font-size:10.0pt;font-family:"Verdana",sans-serif;color:#1F497D">Jason</span></span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span class="size"><span style="font-size:10.0pt;font-family:"Verdana",sans-serif;color:#1F497D"> </span></span><o:p></o:p></p>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span class="size"><b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">From:</span></b></span><span class="size"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">
gdal-dev [<a href="mailto:gdal-dev-bounces@lists.osgeo.org">mailto:gdal-dev-bounces@lists.osgeo.org</a>]
<b>On Behalf Of </b>Luís de Sousa</span></span><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"><br>
<span class="size"><b>Sent:</b> Tuesday, April 12, 2016 9:14 AM</span><br>
<span class="size"><b>To:</b> <a href="mailto:gdal-dev@lists.osgeo.org">gdal-dev@lists.osgeo.org</a></span><br>
<span class="size"><b>Subject:</b> [gdal-dev] How to add GDAL as a dependency to a Python package?</span></span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">Dear all,<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
</div>
<div>
<p>I am trying to package a Python script that uses GDAL for PyPI. I started by including a direct reference in my
<span class="size"><span style="font-size:10.0pt;font-family:"Courier New"">setup.py</span></span>:<o:p></o:p></p>
<p><span class="size"><span style="font-size:10.0pt;font-family:"Courier New"">install_requires=['GDAL==1.11.2'],</span></span><o:p></o:p></p>
<p>This way the package failed to install in my test virtual environment:<o:p></o:p></p>
<pre><span class="pln">extensions</span><span class="pun">/</span><span class="pln">gdal_wrap</span><span class="pun">.</span><span class="pln">cpp</span><span class="pun">:</span><span class="lit">2855</span><span class="pun">:</span><span class="lit">22</span><span class="pun">:</span><span class="pln"> fatal error</span><span class="pun">:</span><span class="pln"> cpl_port</span><span class="pun">.</span><span class="pln">h</span><span class="pun">:</span><span class="pln"> </span><span class="typ">No</span><span class="pln"> such file </span><span class="kwd">or</span><span class="pln"> directory</span><o:p></o:p></pre>
<pre><span class="com">#include "cpl_port.h"</span><o:p></o:p></pre>
<pre><span class="pln"> </span><span class="pun">^</span><o:p></o:p></pre>
<pre><span class="pln">compilation terminated</span><span class="pun">.</span><o:p></o:p></pre>
<pre><span class="pln">error</span><span class="pun">:</span><span class="pln"> </span><span class="typ">Setup</span><span class="pln"> script exited </span><span class="kwd">with</span><span class="pln"> error</span><span class="pun">:</span><span class="pln"> command </span><span class="str">'x86_64-linux-gnu-gcc'</span><span class="pln"> failed </span><span class="kwd">with</span><span class="pln"> exit status </span><span class="lit">1</span><o:p></o:p></pre>
<p>I then tried it with a reference to <span class="size"><span style="font-size:10.0pt;font-family:"Courier New"">pygdal</span></span>, since it is marked as a virtualenv friendly version:<o:p></o:p></p>
<p><span class="size"><span style="font-size:10.0pt;font-family:"Courier New"">install_requires=['pygdal'],</span></span><o:p></o:p></p>
<p>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:<o:p></o:p></p>
<pre><span class="typ">Traceback</span><span class="pln"> </span><span class="pun">(</span><span class="pln">most recent call last</span><span class="pun">):</span><o:p></o:p></pre>
<pre><span class="pln"> </span><span class="typ">File</span><span class="pln"> </span><span class="str">"/home/desouslu/.virtualenvs/test_p3/bin/hasc2gml"</span><span class="pun">,</span><span class="pln"> line </span><span class="lit">5</span><span class="pun">,</span><span class="pln"> </span><span class="kwd">in</span><span class="pln"> </span><span class="pun"><</span><span class="pln">module</span><span class="pun">></span><o:p></o:p></pre>
<pre><span class="pln"> </span><span class="kwd">from</span><span class="pln"> pkg_resources </span><span class="kwd">import</span><span class="pln"> load_entry_point</span><o:p></o:p></pre>
<pre><span class="pln"> </span><span class="typ">File</span><span class="pln"> </span><span class="str">"/home/desouslu/.virtualenvs/test_p3/lib/python3.4/site-packages/pkg_resources.py"</span><span class="pun">,</span><span class="pln"> line </span><span class="lit">2716</span><span class="pun">,</span><span class="pln"> </span><span class="kwd">in</span><span class="pln"> </span><span class="pun"><</span><span class="pln">module</span><span class="pun">></span><o:p></o:p></pre>
<pre><span class="pln"> working_set</span><span class="pun">.</span><span class="pln">require</span><span class="pun">(</span><span class="pln">__requires__</span><span class="pun">)</span><o:p></o:p></pre>
<pre><span class="pln"> </span><span class="typ">File</span><span class="pln"> </span><span class="str">"/home/desouslu/.virtualenvs/test_p3/lib/python3.4/site-packages/pkg_resources.py"</span><span class="pun">,</span><span class="pln"> line </span><span class="lit">685</span><span class="pun">,</span><span class="pln"> </span><span class="kwd">in</span><span class="pln"> require</span><o:p></o:p></pre>
<pre><span class="pln"> needed </span><span class="pun">=</span><span class="pln"> self</span><span class="pun">.</span><span class="pln">resolve</span><span class="pun">(</span><span class="pln">parse_requirements</span><span class="pun">(</span><span class="pln">requirements</span><span class="pun">))</span><o:p></o:p></pre>
<pre><span class="pln"> </span><span class="typ">File</span><span class="pln"> </span><span class="str">"/home/desouslu/.virtualenvs/test_p3/lib/python3.4/site-packages/pkg_resources.py"</span><span class="pun">,</span><span class="pln"> line </span><span class="lit">588</span><span class="pun">,</span><span class="pln"> </span><span class="kwd">in</span><span class="pln"> resolve</span><o:p></o:p></pre>
<pre><span class="pln"> </span><span class="kwd">raise</span><span class="pln"> </span><span class="typ">DistributionNotFound</span><span class="pun">(</span><span class="pln">req</span><span class="pun">)</span><o:p></o:p></pre>
<pre><span class="pln">pkg_resources</span><span class="pun">.</span><span class="typ">DistributionNotFound</span><span class="pun">:</span><span class="pln"> pygdal</span><o:p></o:p></pre>
<p>What is the correct way of setting GDAL as a dependency?<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">Thank you,<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">Luís<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><i>Sent from
<a href="https://protonmail.ch">ProtonMail</a>, encrypted email based in Switzerland.</i><o:p></o:p></p>
</div>
</div>
</blockquote>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</div>
</body>
</html>