OTB 7.x and OsGeo / gdal python wrapper lib

Hi OTB User,

i come to you, because i think miss something in the use of OTB 7.x.
I set up an OTB 7.x (i try 7.1,7.2,7.3) using OTB-7.3.0-Linux64.run script,
Install is fine, OTB binaries run well , except for some GDAL tools that reference gdal python wrapper.

It looks like python wrapper osgeo/gdal is not installed anymore by the script?

Traceback (most recent call last):
File “/OTB-7.3.0-Linux64/bin/gdal_merge.py”, line 5, in
from osgeo.utils.gdal_merge import * # noqa
ImportError: No module named ‘osgeo’

i do not see any site-packages directory in /OTB-7.3.0-Linux64/lib/

Previously i was using OTB 6.6.0, and there , we got it /OTB-6.6.0-Linux64/lib/python2.7/site-packages/osgeo (and it works fine) .

Do I miss some specifics options running the OTB-7.3.0-Linux64.run script ?

Thanks for any help.

Hello Sébastien,

Thanks for your message.
I’ve checked on my own installation and I have the same problem with last version (OTB 7.3) whereas it works fine with OTB 7.2 or older versions.

It seems that these GDAL tools have been deprecated in the stand-alone packages :

~/Install/OTB-7.3.0-Linux64$ more bin/gdalmove.py 
#!/usr/bin/env python3

import sys
# import osgeo.utils.gdalmove as a convenience to use as a script
from osgeo.utils.gdalmove import *  # noqa
from osgeo.utils.gdalmove import main
from osgeo.gdal import deprecation_warn

deprecation_warn('gdalmove', 'utils')

I guess it’s a bug in the packaging process : I will report it on gitlab.orfeo-toolbox.org


Thanks yannick,
lucky you, even with otb-7.1, otb-7.2 i can’t run gdal_merge.py,
i have had to get back to OTB-6.6.0 to use it.

I will follow the reply to the issue you post, and cross finger.