I want to read sentinel-2's image (jp2 format) with anaconda:

  • geopanda: for read shapefile
  • folium (for create map in jupyter notebook ) (optional)
  • gdal /osgeo : for read jp2 image

I follow this excellent tutorial:


My problem is that geopandas and fiona, maybe folium are not compatible with gdal v3.0.0.

With this command : conda install gdal , gdal v3.0.0 is installed by defaut.

If you install geopanda, then gdal is downgraded, but gdal v2... does not read jp2 image.

If I do not install geopanda then I cannot read shapefile.

If I install geopanda after installing gdal, then gdal cannot read a jp2 image.

Is there any way to read the jp2 with gdal downgraded?

EDIT: This is what anaconda does when I install geopandas

The following packages will be REMOVED:

geotiff-1.5.1-h6e819c3_4 proj-6.2.0-ha7a8c7b_1

The following packages will be UPDATED:

pcre conda-forge::pcre-8.41-h6538335_1003 --> pkgs/main::pcre- 8.43-ha925a31_0

The following packages will be SUPERSEDED by a higher-priority channel:

gdal conda-forge::gdal-3.0.1-py36h2fee047_9 --> pkgs/main::gdal- 2.3.3-py36hdf43c64_0 geos conda-forge::geos-3.7.2-he025d50_2 --> pkgs/main::geos- 3.7.1-h33f27b4_0 icu conda-forge::icu-64.2-he025d50_1 --> pkgs/main::icu-5 8.2-ha66f8fd_1 libgdal conda-forge::libgdal-3.0.1-haf49bb1_9 --> pkgs/main::libgd al-2.3.3-h10f50ba_0 rasterio
conda-forge::rasterio-1.0.28-py36h261~ --> pkgs/main::raste rio-1.0.21-py36h6bd7d87_0

The following packages will be DOWNGRADED:

hdf5 1.10.5-nompi_ha405e13_1103 --> 1.10.4-nompi_hcc 15c50_1106 kealib 1.4.10-hf7dc31f_1005 --> 1.4.10-heacb130_ 1003 libnetcdf 4.6.2-h376842a_1003 --> 4.6.2-h396784b_1 001 libspatialite 4.3.0a-hee5a54d_1031 --> 4.3.0a-h6a0152f_ 1026

If I validate this choice, then jp2 driver is remove to the list gdalinfo --formats.

I need on the same platform of geopandas, gdal and rasterio.

Is there a solution?

  • 1
    I have QGIS 3.82-Zanzibar running against GDAL/OGR 2.4 and it perfectly read jp2 format. You can try with a little sample of a jp2 or geotiff raster and to observe if issues persist.
    – xunilk
    Commented Oct 6, 2019 at 15:47
  • Thanks. Yes I have Qgis Zanzibar and I want read jp2. But with anaconda, the issues persist. I do not know where the issues may come from. I tested several things, I really have no idea.
    – chap
    Commented Oct 6, 2019 at 15:55
  • 1
    Yes, I know that but your issue with anaconda isn't with GDAL version. As I said before, you can try with a little sample of a jp2 or geotiff raster and to observe if issues persist or to use python interpreter in OSGEO Console to read these samples.
    – xunilk
    Commented Oct 6, 2019 at 16:02
  • Have you seen this Q&A?: gis.stackexchange.com/q/214489/8104
    – Aaron
    Commented Oct 7, 2019 at 3:32
  • Yes I seen, but it forces me to use a second gdal, outside of Anaconda platform. I edited my primary post with a list of package downgraded.
    – chap
    Commented Oct 7, 2019 at 12:28


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.