<div dir="ltr">Hi Carsten,<div><br></div><div>> You mean that I should zip the whole Python installation folder and copy it to the customer environment?, Or just the Scripts folder?</div><p class="MsoNormal"><u></u></p><div>Zipping just the scripts folder won't be helpful, as they are only thin wrappers that are fully dependent on Python and the respective script.</div><div><br></div><div>It would be better to zip the whole Python folder and unzip it on the other computer to the exact same path. </div><div>Otherwise - the exe files in the scripts folder might not work (IIRC they are created when you install Python or the respective package and hardcode the Python path so you can run them from any folder if they are in the Windows Path).<br></div><div><br></div><div>You can avoid using the files in the Scripts folder, by calling the script explicitly (so you are not dependent on any specific folder location or folder in the path):</div><div>For example, for gdal_calc:</div><div>`c:\path_to_your_python\python -m osgeo_utils.gdal_calc <input>`</div><div>or for pip:</div><div>`c:\path_to_your_python\python -m pip install <input>`<br></div><div><br></div><div>Otherwise, if you still want to call the scripts without the full explicit command then you should note that there were some changes in the wrappers in gdal 3.5.</div><div>In gdal < 3.5 the scripts were thin python wrapper fils, which you could create batch files for easier access for them:</div><div><a href="https://github.com/OSGeo/gdal/blob/master/swig/python/gdal-utils/osgeo_utils/auxiliary/batch_creator.py">https://github.com/OSGeo/gdal/blob/master/swig/python/gdal-utils/osgeo_utils/auxiliary/batch_creator.py</a></div><div>I gdal >= 3.5 those wrappers were replaced by thin exe wrappers (which I think won't work if you change your python folder after installing them):</div><div><a href="https://github.com/OSGeo/gdal/pull/5296">https://github.com/OSGeo/gdal/pull/5296</a><br></div><div><br></div><div>> I had also thought of the third option with the "stand alone app". I was just not sure if all dependencies (e.g. numpy) are included.</div><div>I think that dependencies are handled, but again, I don't think that would be helpful for your use case.</div><p class="MsoNormal"><br></p><div><p class="MsoNormal">> I had already tried to install <span class="gmail-il">GDAL</span> via „pip install <span class="gmail-il">GDAL</span>“, but it requires c++ build tools.<u> </u>Can't this be simplified? </p></div><div>Yes, it's complicated, you can see discussion here:</div><div><a href="https://github.com/OSGeo/gdal/issues/4352">https://github.com/OSGeo/gdal/issues/4352</a><br></div><div><br></div><div>> Why are scripts like <span class="gmail-il">gdal_calc</span> not included to the „standard“ package so that they can be run similarly to gdalinfo?</div>gdal_calc was implemented only in Python (utilizing the power of Python...). <div>gdalinfo was implemented in c++ (and with a Python clone for educational purposes)<br class="gmail-Apple-interchange-newline"><div><br></div><div>Kind regards,</div><div>Idan</div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, 7 Jan 2023 at 02:18, Carsten Lockenkötter <<a href="mailto:carsten.lockenkoetter@web.de">carsten.lockenkoetter@web.de</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div class="msg-4486211911297131806"><div lang="DE" style="overflow-wrap: break-word;"><div class="m_-4486211911297131806WordSection1"><p class="MsoNormal"><span>Hi Idan,<u></u><u></u></span></p><p class="MsoNormal"><span><u></u> <u></u></span></p><p class="MsoNormal"><span>Yes, the operating system is Windows.<u></u><u></u></span></p><p class="MsoNormal"><span>You mean that I should zip the whole Python installation folder and copy it to the customer environment? <u></u><u></u></span></p><p class="MsoNormal"><span>Or just the Scripts folder? <u></u><u></u></span></p><p class="MsoNormal"><span>Sorry, I am a beginner in Python.<u></u><u></u></span></p><p class="MsoNormal"><span><u></u> <u></u></span></p><p class="MsoNormal"><span>I had also thought of the third option with the "stand alone app".<u></u><u></u></span></p><p class="MsoNormal"><span>I was just not sure if all dependencies (e.g. numpy) are included.<u></u><u></u></span></p><p class="MsoNormal"><span><u></u> <u></u></span></p><p class="MsoNormal"><span>I will try out the options soon, thank you.<u></u><u></u></span></p><p class="MsoNormal"><span>I had just hoped that there was an easier way.<u></u><u></u></span></p><p class="MsoNormal"><span>It's a pity that the path with Python is so difficult for beginners and that you may have to install it from an unofficial source.<u></u><u></u></span></p><p class="MsoNormal"><span>I had already tried to install GDAL via „pip install GDAL“, but it requires c++ build tools.<u></u><u></u></span></p><p class="MsoNormal"><span>Can't this be simplified?<u></u><u></u></span></p><p class="MsoNormal"><span><u></u> <u></u></span></p><p class="MsoNormal"><span>Why are scripts like gdal_calc not included to the „standard“ package so that they can be run similarly to gdalinfo?<u></u><u></u></span></p><p class="MsoNormal"><span>This would probably make everything a little easier.<u></u><u></u></span></p><p class="MsoNormal"><span><u></u> <u></u></span></p><p class="MsoNormal"><span>Regards,<u></u><u></u></span></p><p class="MsoNormal"><span>Carsten<u></u><u></u></span></p><p class="MsoNormal"><span><u></u> <u></u></span></p><div style="border-right:none;border-bottom:none;border-left:none;border-top:1pt solid rgb(225,225,225);padding:3pt 0cm 0cm"><p class="MsoNormal"><b>Von:</b> Idan Miara <<a href="mailto:idan@miara.com" target="_blank">idan@miara.com</a>> <br><b>Gesendet:</b> Freitag, 6. Januar 2023 21:15<br><b>An:</b> Carsten Lockenkötter <<a href="mailto:carsten.lockenkoetter@web.de" target="_blank">carsten.lockenkoetter@web.de</a>><br><b>Cc:</b> <a href="mailto:gdal-dev@lists.osgeo.org" target="_blank">gdal-dev@lists.osgeo.org</a><br><b>Betreff:</b> Re: [gdal-dev] Using gdal_calc without python<u></u><u></u></p></div><p class="MsoNormal"><u></u> <u></u></p><div><p class="MsoNormal">Hi!<u></u><u></u></p><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal">gdal_calc is implemented fully in python, so you would need python to run it.<u></u><u></u></p></div><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal">Assuming your client uses Windows and you don't have admin privileges to install software, you could install official Python and gdal (from <a href="https://www.lfd.uci.edu/~gohlke/pythonlibs/" target="_blank">https://www.lfd.uci.edu/~gohlke/pythonlibs/</a>, which unfortunately is not maintained anymore) on another Windows machine and then just zip it and unzip on your clients' pc. <u></u><u></u></p></div><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal">Another option is using OSGeo4W (or QGIS).<u></u><u></u></p></div><div><p class="MsoNormal">In the same way, you could also be able to install it, zip and unzip (I haven't tried this method recently)<u></u><u></u></p></div><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal">You might still need to install on your clients' pc Visual Studio Redistributables (which I think both Python and QGIS installers install for you automatically).<u></u><u></u></p></div><div><p class="MsoNormal">I was successful with both methods, but I think that the first method is easier.<u></u><u></u></p></div><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal">Maybe also <a href="https://pyinstaller.org/en/stable/" target="_blank">https://pyinstaller.org/en/stable/</a> could help if you needed to pack gdal_calc more like a "stand alone app", but I think that wasn't your issue.<u></u><u></u></p></div><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal">Kind regards,<u></u><u></u></p></div><div><p class="MsoNormal">Idan<u></u><u></u></p></div></div><p class="MsoNormal"><u></u> <u></u></p><div><div><p class="MsoNormal">On Fri, 6 Jan 2023 at 21:34, Carsten Lockenkötter <<a href="mailto:carsten.lockenkoetter@web.de" target="_blank">carsten.lockenkoetter@web.de</a>> wrote:<u></u><u></u></p></div><blockquote style="border-top:none;border-right:none;border-bottom:none;border-left:1pt solid rgb(204,204,204);padding:0cm 0cm 0cm 6pt;margin-left:4.8pt;margin-right:0cm"><div><div><div><p class="MsoNormal">Hi,<u></u><u></u></p><p class="MsoNormal"> <u></u><u></u></p><p class="MsoNormal">I'm currently building a workflow to crop possible white or black borders from my Geotiff files and create raster tiles with an alpha band.<u></u><u></u></p><p class="MsoNormal">I'm using some Python functions provided by you, such as gdal_calc.py.<u></u><u></u></p><p class="MsoNormal"> <u></u><u></u></p><p class="MsoNormal">My workflow works so far, but my problem is that I have to run everything on my customer's server. <u></u><u></u></p><p class="MsoNormal">Unfortunately, I don't have the ability to install software there, so I can't install Python and gdal_calc.py can't be run.<u></u><u></u></p><p class="MsoNormal"> <u></u><u></u></p><p class="MsoNormal">So far, I've always downloaded the compiled binaries from <a href="http://gisinternals.com" target="_blank">gisinternals.com</a> and copied them to the server (the zip archive) to use gdalwarp, for example. <u></u><u></u></p><p class="MsoNormal">But with that, I can't run gdal_calc, right? Python is still needed for that, or am I mistaken?<u></u><u></u></p><p class="MsoNormal"> <u></u><u></u></p><p class="MsoNormal">Is there a way to use gdal_calc/gdal_retile without having to install software components? <u></u><u></u></p><p class="MsoNormal">If there are approaches to control the functions through a wrapper, that would also help me. <u></u><u></u></p><p class="MsoNormal">I have knowledge in C# and could use MaxRev.Gdal.Core, for example. However, I haven't found an approach yet to use gdal_calc. <u></u><u></u></p><p class="MsoNormal">I probably have to rewrite the Python script in C#?<u></u><u></u></p><p class="MsoNormal"> <u></u><u></u></p><p class="MsoNormal">Regards,<u></u><u></u></p><p class="MsoNormal">Carsten<u></u><u></u></p></div></div><p class="MsoNormal">_______________________________________________<br>gdal-dev mailing list<br><a href="mailto:gdal-dev@lists.osgeo.org" target="_blank">gdal-dev@lists.osgeo.org</a><br><a href="https://lists.osgeo.org/mailman/listinfo/gdal-dev" target="_blank">https://lists.osgeo.org/mailman/listinfo/gdal-dev</a><u></u><u></u></p></div></blockquote></div></div></div></div></blockquote></div>