<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title></title>
</head>
<body>
<div name="messageBodySection">
<div dir="auto">Hi <br>
<br>
My gdal installation with brew, <a href="https://formulae.brew.sh/formula/gdal" target="_blank">https://formulae.brew.sh/formula/gdal</a>,  do work on macOS:<br>
which gdal_calc.py<br>
/usr/local/bin/gdal_calc.py<br>
<br>
ls -l /usr/local/bin/gdal_calc*<br>
/usr/local/bin/gdal_calc.py -> ../Cellar/gdal/3.3.2_3/bin/gdal_calc.py<br>
<br>
Do you have to use Anaconda?</div>
</div>
<div name="messageSignatureSection"><br>
<div class="matchFont">Best Regards<br>
<br>
Andreas Oxenstierna<br>
T-Kartor Geospatial AB<br>
Olof Mohlins väg 12 Kristianstad<br>
mobile: +46 733 206831<br>
mailto: <a href="mailto:andreas.oxenstierna@t-kartor.com">andreas.oxenstierna@t-kartor.com</a><br>
<a href="http://www.t-kartor.com">www.t-kartor.com</a></div>
</div>
<div name="messageReplySection">On 28 Jun 2022, 05:19 +0200, Chao Li <chaoli0394@gmail.com>, wrote:<br>
<blockquote type="cite" style="border-left-color: grey; border-left-width: thin; border-left-style: solid; margin: 5px 5px;padding-left: 10px;">
<div dir="ltr">Hi,
<div><br>
</div>
<div>I meet a problem when I use gdal_calc.py on mac:</div>
<div><br>
</div>
<div>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)">
<span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">(base) lichao@riushios-MacBook-Pro ~ % gdal_calc.py
<span class="gmail-Apple-converted-space">           </span></span></p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)">
<span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">Traceback (most recent call last):</span></p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)">
<span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space"> </span> File "/Users/lichao/opt/anaconda3/lib/python3.9/site-packages/osgeo/__init__.py", line 29, in swig_import_helper</span></p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)">
<span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space">   </span> return importlib.import_module(mname)</span></p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)">
<span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space"> </span> File "/Users/lichao/opt/anaconda3/lib/python3.9/importlib/__init__.py", line 127, in import_module</span></p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)">
<span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space">   </span> return _bootstrap._gcd_import(name[level:], package, level)</span></p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)">
<span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space"> </span> File "<frozen importlib._bootstrap>", line 1030, in _gcd_import</span></p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)">
<span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space"> </span> File "<frozen importlib._bootstrap>", line 1007, in _find_and_load</span></p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)">
<span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space"> </span> File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked</span></p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)">
<span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space"> </span> File "<frozen importlib._bootstrap>", line 666, in _load_unlocked</span></p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)">
<span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space"> </span> File "<frozen importlib._bootstrap>", line 565, in module_from_spec</span></p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)">
<span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space"> </span> File "<frozen importlib._bootstrap_external>", line 1173, in create_module</span></p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)">
<span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space"> </span> File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed</span></p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)">
<span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">ImportError: dlopen(/Users/lichao/opt/anaconda3/lib/python3.9/site-packages/osgeo/_<a href="http://gdal.cpython-39-darwin.so">gdal.cpython-39-darwin.so</a>, 0x0002): Library not loaded:
 @rpath/libpoppler.91.dylib</span></p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)">
<span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space"> </span> Referenced from: /Users/lichao/opt/anaconda3/lib/libgdal.30.dylib</span></p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)">
<span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space"> </span> Reason: tried: '/Users/lichao/opt/anaconda3/lib/libpoppler.91.dylib' (no such file), '/Users/lichao/opt/anaconda3/lib/libpoppler.91.dylib'
 (no such file), '/Users/lichao/opt/anaconda3/lib/libpoppler.91.dylib' (no such file), '/Users/lichao/opt/anaconda3/lib/python3.9/site-packages/osgeo/../../../libpoppler.91.dylib' (no such file), '/Users/lichao/opt/anaconda3/lib/libpoppler.91.dylib' (no such
 file), '/Users/lichao/opt/anaconda3/lib/libpoppler.91.dylib' (no such file), '/Users/lichao/opt/anaconda3/lib/python3.9/site-packages/osgeo/../../../libpoppler.91.dylib' (no such file), '/Users/lichao/opt/anaconda3/lib/libpoppler.91.dylib' (no such file),
 '/Users/lichao/opt/anaconda3/bin/../lib/libpoppler.91.dylib' (no such file), '/Users/lichao/opt/anaconda3/lib/libpoppler.91.dylib' (no such file), '/Users/lichao/opt/anaconda3/bin/../lib/libpoppler.91.dylib' (no such file), '/usr/local/lib/libpoppler.91.dylib'
 (no such file), '/usr/lib/libpoppler.91.dylib' (no such file)</span></p>
<p class="gmail-p2" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0);min-height:13px">
<span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"></span><br>
</p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)">
<span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">During handling of the above exception, another exception occurred:</span></p>
<p class="gmail-p2" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0);min-height:13px">
<span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"></span><br>
</p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)">
<span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">Traceback (most recent call last):</span></p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)">
<span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space"> </span> File "/Users/lichao/opt/anaconda3/bin/gdal_calc.py", line 4, in <module></span></p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)">
<span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space">   </span> __import__('pkg_resources').run_script('GDAL==3.4.1', 'gdal_calc.py')</span></p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)">
<span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space"> </span> File "/Users/lichao/opt/anaconda3/lib/python3.9/site-packages/pkg_resources/__init__.py", line 662, in run_script</span></p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)">
<span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space">   </span> self.require(requires)[0].run_script(script_name, ns)</span></p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)">
<span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space"> </span> File "/Users/lichao/opt/anaconda3/lib/python3.9/site-packages/pkg_resources/__init__.py", line 1459, in run_script</span></p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)">
<span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space">   </span> exec(code, namespace, namespace)</span></p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)">
<span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space"> </span> File "/Users/lichao/opt/anaconda3/lib/python3.9/site-packages/GDAL-3.4.1-py3.9-macosx-10.9-x86_64.egg-info/scripts/gdal_calc.py", line
 5, in <module></span></p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)">
<span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space">   </span> from osgeo_utils.gdal_calc import *<span class="gmail-Apple-converted-space"> </span> # noqa</span></p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)">
<span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space"> </span> File "/Users/lichao/opt/anaconda3/lib/python3.9/site-packages/osgeo_utils/gdal_calc.py", line 46, in <module></span></p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)">
<span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space">   </span> from osgeo import gdal</span></p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)">
<span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space"> </span> File "/Users/lichao/opt/anaconda3/lib/python3.9/site-packages/osgeo/__init__.py", line 45, in <module></span></p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)">
<span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space">   </span> _gdal = swig_import_helper()</span></p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)">
<span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space"> </span> File "/Users/lichao/opt/anaconda3/lib/python3.9/site-packages/osgeo/__init__.py", line 42, in swig_import_helper</span></p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)">
<span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space">   </span> return importlib.import_module('_gdal')</span></p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)">
<span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space"> </span> File "/Users/lichao/opt/anaconda3/lib/python3.9/importlib/__init__.py", line 127, in import_module</span></p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)">
<span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space">   </span> return _bootstrap._gcd_import(name[level:], package, level)</span></p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)">
<span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">ModuleNotFoundError: No module named '_gdal'</span></p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)">
<br>
</p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)">
<span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">(base) lichao@riushios-MacBook-Pro ~ % which gdal_calc.py</span></p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)">
<span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">/Users/lichao/opt/anaconda3/bin/gdal_calc.py</span></p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)">
<span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><br>
</span></p>
<p class="gmail-p1" style="margin:0px;font:11px Menlo;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">(base) lichao@riushios-MacBook-Pro ~ % gdal-config --version</span></p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)">
<span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"></span></p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)">
<span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">3.4.1</span></p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)">
<span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><br>
</span></p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)">
<span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">Thanks for your help.</span></p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)">
<span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><br>
</span></p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)">
<span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">Best</span></p>
<div><br>
</div>
--<br>
<div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature">
<div dir="ltr">
<div>
<div dir="ltr">
<div>
<div dir="ltr">------------------------------------------------------------------------------------</div>
<div dir="ltr">Mike Li
<div>Department of Urban and Environmental Engineering</div>
<div>Graduate School of Engineering</div>
<div>Kyushu University</div>
<div>744 Motooka, Nishi-ku, Fukuoka 819-0395 Japan</div>
<div>Tel: 090-8304-8953</div>
<div>E-mail: <a href="mailto:chaoli0394@gmail.com" target="_blank">chaoli0394@gmail.com</a></div>
<div>-------------------------------------------------------------------------------------</div>
<div>李潮(リ チョウ)</div>
<div>九州大学 大学院 工学府 都市環境システム工学専攻</div>
<div>都市工学研究室</div>
<div>-------------------------------------------------------------------------------------</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</blockquote>
</div>
</body>
</html>