<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
That't great, Idan! <span style="color: rgb(0, 0, 0); font-family: Calibri, Helvetica, sans-serif; font-size: 12pt;">Thank you, I will look into it to add it to my code. </span></div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<span style="color: rgb(0, 0, 0); font-family: Calibri, Helvetica, sans-serif; font-size: 12pt;">Thanks, </span></div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<span style="color: rgb(0, 0, 0); font-family: Calibri, Helvetica, sans-serif; font-size: 12pt;">Rafael</span></div>
<div id="appendonsend"></div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>De:</b> Idan Miara <idan@miara.com><br>
<b>Enviado:</b> quarta-feira, 12 de janeiro de 2022 18:26<br>
<b>Para:</b> Rafael Lima <raplima@hotmail.com><br>
<b>Cc:</b> Even Rouault <even.rouault@spatialys.com>; gdal dev <gdal-dev@lists.osgeo.org><br>
<b>Assunto:</b> Re: [gdal-dev] How to fix path for gdal .py scripts in Anaconda-Windows?</font>
<div> </div>
</div>
<div>
<div dir="auto">
<div>Hi,
<div dir="auto"><br>
<div dir="auto">I had the same problem, here's my solution :</div>
<div dir="auto"><a href="https://github.com/OSGeo/gdal/blob/master/swig/python/gdal-utils/osgeo_utils/auxiliary/batch_creator.py" target="_blank" rel="noreferrer">https://github.com/OSGeo/gdal/blob/master/swig/python/gdal-utils/osgeo_utils/auxiliary/batch_creator.py</a><br>
</div>
<div dir="auto"><br>
</div>
<div dir="auto">Idan</div>
</div>
<br>
<br>
<div class="x_gmail_quote">
<div dir="ltr" class="x_gmail_attr">On Wed, 12 Jan 2022, 23:22 Rafael Lima, <<a href="mailto:raplima@hotmail.com" target="_blank" rel="noreferrer">raplima@hotmail.com</a>> wrote:<br>
</div>
<blockquote class="x_gmail_quote" style="margin:0 0 0 .8ex; border-left:1px #ccc solid; padding-left:1ex">
<div dir="ltr">
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
I thought about uninstalling it to lol</div>
<blockquote style="border-left:3px solid rgb(200,200,200); border-top-color:rgb(200,200,200); border-right-color:rgb(200,200,200); border-bottom-color:rgb(200,200,200); padding-left:1ex; margin-left:0.8ex; color:rgb(102,102,102)">
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<span style="font-size:14px; background-color:rgb(255,255,255); display:inline!important">checking that PYTHONPATH or PYTHONHOME are not defined to an unexpected value will be sufficient</span><br>
</div>
</blockquote>
<div id="x_m_6458025269046370629m_-3229482005576796935appendonsend"></div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
It was something of the sorts. The paths were actually fine, but the "default windows app" is activated when calling a file with a .py extension. So calling ogrmerge.py on the terminal would activate the default app instead of the activated python =/</div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
Thanks!</div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<hr style="display:inline-block; width:98%">
<div id="x_m_6458025269046370629m_-3229482005576796935divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>De:</b> gdal-dev <<a href="mailto:gdal-dev-bounces@lists.osgeo.org" rel="noreferrer noreferrer" target="_blank">gdal-dev-bounces@lists.osgeo.org</a>>
em nome de Even Rouault <<a href="mailto:even.rouault@spatialys.com" rel="noreferrer noreferrer" target="_blank">even.rouault@spatialys.com</a>><br>
<b>Enviado:</b> quarta-feira, 12 de janeiro de 2022 16:09<br>
<b>Para:</b> <a href="mailto:gdal-dev@lists.osgeo.org" rel="noreferrer noreferrer" target="_blank">
gdal-dev@lists.osgeo.org</a> <<a href="mailto:gdal-dev@lists.osgeo.org" rel="noreferrer noreferrer" target="_blank">gdal-dev@lists.osgeo.org</a>><br>
<b>Assunto:</b> Re: [gdal-dev] How to fix path for gdal .py scripts in Anaconda-Windows?</font>
<div> </div>
</div>
<div>
<p>I would have suggested to uninstall the offending proprietary software :-), but perhaps checking that PYTHONPATH or PYTHONHOME are not defined to an unexpected value will be sufficient<br>
</p>
<div>Le 12/01/2022 à 19:24, Rafael Lima a écrit :<br>
</div>
<blockquote type="cite">
<div>## Expected behavior and actual behavior.
<div><br>
</div>
<div>I installed gdal on a Windows environment using anaconda and tried using one of the .py scripts (e.g., ogrmerge.py). I expected the script to make use of the gdal installed in such an environment, but it seems that the script finds another gdal installation
(screenshot below), thus throwing an error. My question seems to be related to the one in
<a href="https://stackoverflow.com/questions/69328298/cannot-run-a-py-which-requires-a-gdal-module-in-anaconda-prompt-nor-in-command" rel="noreferrer noreferrer" target="_blank">
https://stackoverflow.com/questions/69328298/cannot-run-a-py-which-requires-a-gdal-module-in-anaconda-prompt-nor-in-command</a>, apparently unsolved. I was wondering what is the correct approach to make sure gdal scripts find the correct gdal?</div>
<div><br>
</div>
<div>## Steps to reproduce the problem.</div>
<div>create a conda environment:</div>
<div>conda create -n test1 gdal</div>
<div>activate the environment</div>
<div>conda activate test1</div>
<div>call a gdal .py script</div>
<div>ogrmerge.py</div>
<div><br>
</div>
<div>In my case, that throws an error apparently because the script uses another gdal installation:</div>
<div><img data-outlook-trace="F:0|T:1" src="cid:part1.66CDEAD4.863B431E@spatialys.com"><br>
</div>
<div><br>
</div>
<div>## Operating system</div>
<div><br>
</div>
<div>Windows 10 Pro - 20H2 version </div>
<div><br>
</div>
<div>## GDAL version and provenance</div>
<div><br>
</div>
<div>GDAL==3.0.2 </div>
<div>GDAL==3.4.0</div>
<div><br>
</div>
<div>Thank you!</div>
Rafael<br>
</div>
<br>
<fieldset></fieldset>
<pre>_______________________________________________
gdal-dev mailing list
<a href="mailto:gdal-dev@lists.osgeo.org" rel="noreferrer noreferrer" target="_blank">gdal-dev@lists.osgeo.org</a>
<a href="https://lists.osgeo.org/mailman/listinfo/gdal-dev" rel="noreferrer noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/gdal-dev</a>
</pre>
</blockquote>
<pre cols="72">--
<a href="http://www.spatialys.com" rel="noreferrer noreferrer" target="_blank">http://www.spatialys.com</a>
My software is free, but my time generally not.</pre>
</div>
</div>
_______________________________________________<br>
gdal-dev mailing list<br>
<a href="mailto:gdal-dev@lists.osgeo.org" rel="noreferrer noreferrer" target="_blank">gdal-dev@lists.osgeo.org</a><br>
<a href="https://lists.osgeo.org/mailman/listinfo/gdal-dev" rel="noreferrer noreferrer noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/gdal-dev</a><br>
</blockquote>
</div>
</div>
</div>
</div>
</body>
</html>