GDAL version: can I choose the used version? if yes: how?

1259
2
Jump to solution
07-13-2023 10:16 AM
Labels (1)
nadja_swiss_parks
Occasional Contributor III

I need to verify for a certain task, that ArcGIS Pro 3.1.2 (on Windows 10) uses a specific GDAL version. Can I choose the used GDAL version? If yes, how do I install and select the needed version? 

Tags (1)
1 Solution

Accepted Solutions
Brian_Wilson
Regular Contributor II

I tried just upgrading, in the past this did not work but trying today,

"conda list" for ArcPro 2.9 shows me I have gdal3.3.0 but "conda search gdal" shows me there is a package for 3.7.0 so I tried "conda install gdal=3.7.0"

I did this in a clone of the actual Esri-installed conda environment. I think I have conda set to automatically search the "conda forge".

The first method failed so I tried building a new environment. Using 3.7 failed there too! The error tells me that Esri does not want anything > 3.4 so I tried again... specifying 3.4

conda create --name pro29 --clone arcgispro-py3
conda activate pro29
conda install -c conda-forge gdal=3.7.0

While that was grinding away taking forever I also did this in another window. It completed but... is 3.4 good enough for you??
conda create --name arcgdal -c esri -c conda-forge arcpy gdal=3.4
conda activate arcgdal

The first attempt failed with this: 

UnsatisfiableError: The following specifications were found
to be incompatible with the existing python installation in your environment:

SO, if the tool you need only requires 3.4, you're good. If you need something newer than that the remaining option is to use a separate conda environment. This is less convenient but gives you the freedom to install any version. If you need help understanding how to call up a separate conda environment, ask.

conda create --name gdal -c conda-forge gdal
conda activate gdal
$ python
Python 3.11.4 | packaged by conda-forge | (main, Jun 10 2023, 17:59:51) [MSC v.1935 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import osgeo.gdal as gd
>>> gd.__version__
'3.7.0'

You won't have arcpy in this environment but the other tools (python, geos, geotiff, etc) are all up to date.

I'd probably want to install some other stuff in that one, like pandas and possible geopandas for example.

I was able to build an "arcgis" (instead of "arcpy") + gdal conda environment but the gdal version was limited to 3.4 again, drat!

Hope this helps.

 

View solution in original post

2 Replies
Brian_Wilson
Regular Contributor II

I tried just upgrading, in the past this did not work but trying today,

"conda list" for ArcPro 2.9 shows me I have gdal3.3.0 but "conda search gdal" shows me there is a package for 3.7.0 so I tried "conda install gdal=3.7.0"

I did this in a clone of the actual Esri-installed conda environment. I think I have conda set to automatically search the "conda forge".

The first method failed so I tried building a new environment. Using 3.7 failed there too! The error tells me that Esri does not want anything > 3.4 so I tried again... specifying 3.4

conda create --name pro29 --clone arcgispro-py3
conda activate pro29
conda install -c conda-forge gdal=3.7.0

While that was grinding away taking forever I also did this in another window. It completed but... is 3.4 good enough for you??
conda create --name arcgdal -c esri -c conda-forge arcpy gdal=3.4
conda activate arcgdal

The first attempt failed with this: 

UnsatisfiableError: The following specifications were found
to be incompatible with the existing python installation in your environment:

SO, if the tool you need only requires 3.4, you're good. If you need something newer than that the remaining option is to use a separate conda environment. This is less convenient but gives you the freedom to install any version. If you need help understanding how to call up a separate conda environment, ask.

conda create --name gdal -c conda-forge gdal
conda activate gdal
$ python
Python 3.11.4 | packaged by conda-forge | (main, Jun 10 2023, 17:59:51) [MSC v.1935 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import osgeo.gdal as gd
>>> gd.__version__
'3.7.0'

You won't have arcpy in this environment but the other tools (python, geos, geotiff, etc) are all up to date.

I'd probably want to install some other stuff in that one, like pandas and possible geopandas for example.

I was able to build an "arcgis" (instead of "arcpy") + gdal conda environment but the gdal version was limited to 3.4 again, drat!

Hope this helps.

 

nadja_swiss_parks
Occasional Contributor III

Thank yout @Brian_Wilson 

I created an esri idea asking for the possibility to use the newest GDAL version without having to set up a separate conda environment: https://community.esri.com/t5/arcgis-pro-ideas/possibility-to-use-any-gdal-version-even-the/idi-p/13...

0 Kudos