<div>Thanks for the reply Jason. <br></div><div><br></div><div>I gather "they" refers to whomever I need to contact about this issue. Who are "they" then?<br></div><div><br></div><div>Luís<br></div><div><br></div><div class="protonmail_signature_block"><i>Sent from <a href="https://protonmail.ch">ProtonMail</a>, encrypted email based in Switzerland.</i><br></div><div><br></div><div><br></div><blockquote class="protonmail_quote" type="cite"><div>-------- Original Message --------<br></div><div>Subject: RE: [gdal-dev] How to add GDAL as a dependency to a Python package?<br></div><div>Local Time: April 12, 2016 3:25 PM<br></div><div>UTC Time: April 12, 2016 1:25 PM<br></div><div>From: jason.roberts@duke.edu<br></div><div>To: luis.de.sousa@protonmail.ch<br></div><div><br></div><div>
<br></div><div class="WordSection1"><p class="MsoNormal"><span class="colour" style="color:rgb(31, 73, 125)"><span class="font" style="font-family:"Verdana",sans-serif"><span class="size" style="font-size:10pt">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></span><br></p><p class="MsoNormal"><span class="colour" style="color:rgb(31, 73, 125)"><span class="font" style="font-family:"Verdana",sans-serif"><span class="size" style="font-size:10pt"> </span></span></span><br></p><p class="MsoNormal"><span class="colour" style="color:rgb(31, 73, 125)"><span class="font" style="font-family:"Verdana",sans-serif"><span class="size" style="font-size:10pt">Jason</span></span></span><br></p><p class="MsoNormal"><a name="_MailEndCompose"><span class="colour" style="color:rgb(31, 73, 125)"><span class="font" style="font-family:"Verdana",sans-serif"><span class="size" style="font-size:10pt"> </span></span></span></a><br></p><div><span style="mso-bookmark:_MailEndCompose"></span><br></div><p class="MsoNormal"><b><span class="font" style="font-family:"Calibri",sans-serif"><span class="size" style="font-size:11pt">From:</span></span></b><span class="font" style="font-family:"Calibri",sans-serif"><span class="size" style="font-size:11pt"> gdal-dev [mailto:gdal-dev-bounces@lists.osgeo.org]
<b>On Behalf Of </b>Luís de Sousa<br>
<b>Sent:</b> Tuesday, April 12, 2016 9:14 AM<br>
<b>To:</b> gdal-dev@lists.osgeo.org<br>
<b>Subject:</b> [gdal-dev] How to add GDAL as a dependency to a Python package?</span></span></p><p class="MsoNormal"> <br></p><div><p class="MsoNormal">Dear all,<br></p></div><div><p class="MsoNormal"> <br></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
<code><span class="size" style="font-size:10pt">setup.py</span></code>:<br></p><p><code><span class="size" style="font-size:10pt">install_requires=['GDAL==1.11.2'],</span></code><br></p><p>This way the package failed to install in my test virtual environment:<br></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><br></pre><pre><span class="pln"></span><span class="com">#include "cpl_port.h"</span><span class="pln"></span><br></pre><pre><span class="pln"> </span><span class="pun">^</span><span class="pln"></span><br></pre><pre><span class="pln">compilation terminated</span><span class="pun">.</span><span class="pln"></span><br></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><br></pre><p>I then tried it with a reference to <code><span class="size" style="font-size:10pt">pygdal</span></code>, since it is marked as a virtualenv friendly version:<br></p><p><code><span class="size" style="font-size:10pt">install_requires=['pygdal'],</span></code><br></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:<br></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><span class="pln"></span><br></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><span class="pln"></span><br></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><br></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><span class="pln"></span><br></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><span class="pln"></span><br></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><br></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><span class="pln"></span><br></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><br></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><span class="pln"></span><br></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><br></pre><p>What is the correct way of setting GDAL as a dependency?<br></p></div><div><p class="MsoNormal">Thank you,<br></p></div><div><p class="MsoNormal"> <br></p></div><div><p class="MsoNormal">Luís<br></p></div><div><p class="MsoNormal"> <br></p></div><div><p class="MsoNormal"><i>Sent from <a href="https://protonmail.ch">ProtonMail</a>, encrypted email based in Switzerland.</i><br></p></div></div></blockquote><div><br></div>