Install OTB for all users on Debian 12

Context

I am trying to make the OTB installation available to all users of our Debian 12 server, so they can use it in QGIS with the plugin.

Configuration setup

My system: Debian 12
Version of the OTB: 9.1.0
I installed the OTB with: the .tar archives

If relevant, you may also provide:
QGIS version: 3.38
Python version: 3.10/3.11

Description of my issue

Hello everybody!

I am an administrator for our Linux servers where we try to make available for all our scientists different tools and software for use in their research. Among other software, we use QGIS for analyses of geographic data.
Some of our scientists regularly ask me for installation of different plugins to QGIS, so much that it would make sense for some of these tools to be made available generally, because several people want to use them in QGIS. OTB is one of these plugins.

So, I tried to make the OTB available for all users by installing it as root to /opt/OTB using the advanced installation guide here: Installation — Orfeo ToolBox 9.1.0 documentation with /opt/OTB as the install path.

Then I log in as a regular user and try to set the OTB paths in QGIS as described in the CookBook.

i.e.
OTB folder = /opt/OTB
and
OTB application folder = = /opt/OTB/lib/otb/applications

But this does not add any OTB entries to my Processing Toolbox. There are no error messages shown in the QGIS GUI and also not under /tmp/QGIS-xyz where QGIS seems to put its log files.

If I do the exact same installation as a regular user into my home folder instead of /opt everything works: The OTB entries get added to the Processing Toolbox as soon as I click “OK” after setting the folders in QGIS → Options → Processing → Providers → OTB.

It sounds like a permission issue to me? Are there any special permissions that I have to set on the /opt/OTB folder in order for all users to be able to access it from QGIS? It currently is owned by root and has the permissions 755, so all users should be able to read and execute inside the folder but not write there.

It would be very convenient if OTB could be accessed from /opt for all users instead of several users installing it to their home folders individually. Is this generally possible and I only have my permissions wrong?


Side issue:

During the installation, I also ran into the problem that the GDAL Python bindings for OTB 9.1 at Index of /packages/archives/OTB are only available for Python versions 3.10 and 3.12 but not 3.11, which is the default in Debian 12.

Therefore, when running the last step of the Advanced installation method:

source /Path/To/Install/OTB/otbenv.profile

the script failed to download anything since line 44 of the /Path/To/Install/OTB/tools/post_install.sh script tried to download OTB-9.1-GDAL-bindings-py311.tar.gz which does not exist on the server.

I fixed this by changing line 44 to download OTB-9.1-GDAL-bindings-py310.tar.gz regardless of the detected Python version. This seems to work for the installation but may bring problems when actually using the Toolbox, I guess? Is there any recommended way to install the GDAL bindings for OTB 9.1 on a system using Python 3.11? Or is it okay to use the bindings for 3.10 in this case?

Thanks in advance for any answers! :slight_smile:

Hi

You use case is interesting! I think that 755 should do the trick I assume you did a “chmod -R” ? This is how we deploy it for all users in a computing cluster and it works. After the package extract we call “chmod -R a+rx OTB_INSTALL_FOLDER” and people can use it as commandLine or Python.
I think QGIS can work with toolboxes installed in /opt i’ll check, but i’m pretty sure your problem linked to a permissue issue.
Have you tried to “source otbenv.profile” AFTER doing the chmod ? is it working in commandline for all the users ?

About python, we didn’t deploy a py311 package yet because this new mecanism of automatically downloading gdal bindings has just been released with 9.1, at the moment we fully support Ubuntu LTS with 22.04 and 24.04. I’ll come back to you when this package will be available (in a couple of days), this is important that our debian users can fully use the gdal bindings in python.

If you use the python 3.10 gdal bindings you will not be able to do “from osgeo import gdal” ans use the gdal bindings only in python. OTB will work.

Best regards

Hi and thanks for the quick answer!

I did not do any chmod after the installation. After extracting the .tar files, the /opt/OTB folder already had permissions 755 and the files/folder in it had appropriate permissions as well:

For example, the subfolders all had 755, the binaries in /opt/OTB/bin and scripts in /opt/OTB/tools had 755 but the text files (like the readme or licence) had 744, since they don’t need execute.

If I login as a regular user and run commands from the /opt/OTB/bin folder, they work. I tried /opt/OTB/bin/listgeo and it gives me an output with its command line options, etc.

Sorry, I don’t know the actual tools of OTB, but I can have one of our scientists check if the tools do what they should. :wink:

But it looks like the permissions work for the CLI tools, just for some reason QGIS doesn’t accept the paths (or can’t read inside them). Sadly, QGIS does not give any errors for this at all. Although, I’m not sure if it has log files somewhere outside of /tmp. From the QGIS manual, it seems to only put them in /tmp and those stay emtpy when setting the paths for OTB in the settings.

Hi @rokyo ,
Actually the QGis plugin needs files in “<OTB_INSTALL_DIR>/share/otb/description”. Does these files have correct permissions?
Also does logs tab give you anything ? It is located on the bottom of QGIS and can be enabled with (I use the french version, thus translation may change) “View > Panels > Logs”.
Something that looks like:

Hi @rokyo

I uploaded bindings for python 3.11 , the package is called OTB-9.1-GDAL-bindings-py311.tar.gz you can adapt your script according to that.

Let me know if it works
Best regards

Oh, this could be it!

I checked the folder and there are no files at all in there. At least not in the installation I made as root to /opt.
On the other hand, in the installation I performed as a normal user to my home directory, there are several .txt files with permission 640 in this folder.

I copied these files to the global installation under /opt, gave them permission 644 and set the paths in QGIS to /opt/OTB and /opt/OTB/lib/otb/applications again and now it seems to work! The OTB commands are added to my Processing Toolbox again.

Strangely though, the message in the “Logs → Processing” tab now reads “INFO Loading OTB 6.6.0” even though the installation under /opt should be 9.1.0 and the QGIS plugin shows version 3.0.3.

I’m also not sure why the .txt files under INSTALL_DIR/share/otb/descriptions only exist in one of the installations. I did both installs with the same method shown in the Cookbook. The only difference was the install location and the privilege of the user I installed them with (root vs. regular user).

Thanks a lot! I’ll revert my changes to the script and run the source line again! :slight_smile:

Okay nevermind, when I set the paths for the plugin in QGIS back to the install in my home directory, the log message also reads “6.6.0”!

Hi @rokyo , thanks for pointing this out. It is indeed a bug: the plugin does not read the file located in <OTB_INSTALL>/share/doc/otb/VERSION. It seems that you have a problem with the share folder of OTB as there is another file missing.
I opened an issue on the plugin to improve error feedback like this one (Log improvment (#8) · Issues · Main Repositories / otb-QGis-plugin · GitLab).