<div>Dear all,<br></div><div><br></div><div class="post-text"><p>I am trying to package a Python script that uses GDAL for PyPI. I started by including a direct reference in my <code>setup.py</code>:<br></p><p><code>install_requires=['GDAL==1.11.2'],</code><br></p><p>This way the package failed to install in my test virtual environment:<br></p><pre style="" class="lang-py prettyprint prettyprinted"><code><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><span class="com">#include "cpl_port.h"</span><span class="pln">
</span><span class="pun">^</span><span class="pln">
compilation terminated</span><span class="pun">.</span><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></code><br></pre><p>I then tried it with a reference to <code>pygdal</code>, since it is marked as a virtualenv friendly version:<br></p><p><code>install_requires=['pygdal'],</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 style="" class="lang-py prettyprint prettyprinted"><code><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><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><span class="kwd">from</span><span class="pln"> pkg_resources </span><span class="kwd">import</span><span class="pln"> load_entry_point
</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">
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><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
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><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><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">
pkg_resources</span><span class="pun">.</span><span class="typ">DistributionNotFound</span><span class="pun">:</span><span class="pln"> pygdal</span></code><br></pre><p>What is the correct way of setting GDAL as a dependency?<br></p></div><div>Thank you,<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>