2

I want to use two different GDAL versions on my Ubuntu 16.04. I installed GDAL via the UbuntuGIS ppa and via anaconda. My GDAL for python works fine, but when I want to use gdal_translate via the shell to convert a .jp2 to .tif the following error occurs:

ERROR 4: `/media/lastro/.../L2A_T32ULB_20170430T103021_AOT_10m.jp2' not recognized as a supported file format

When I remove anaconda and have only gdal from the ubuntuGIS ppa installed then it works, but when I then install anaconda with the gdal binding the same error occurs.

Does someone know a workaround for this problem?

2

You should set your environment variable to the ubuntuGIS GDAL, as this will have the needed file support. You should have a PATH variable set to the correct GDAL.

First check with the command which -a gdal-config where your GDAL versions are installed. The -a checks for several installations. There should be two in your case. Then check with echo $PATH if you have a PATH set to your installation folder of your Ubuntugis-GDAL. If not you need to set the variable with export PATH=$PATH:/path/to/directory_of_ubuntugis_gdal.

0

It is possible as noted in this post Multiple versions of GDAL (32bit and 64bit) on same machine.

I would count on it being an issue during installation as where the GDAL is being read from and install location perhaps.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.