locationtech / rasterframes

Geospatial Raster support for Spark DataFrames
http://rasterframes.io
Apache License 2.0
240 stars 46 forks source link

problem with latest version of gdal 3.0.4 #525

Closed lalessan closed 3 years ago

lalessan commented 3 years ago

I am trying to use pyrasterframes, but I have been unable to, do to gdal. I am not administrator of the server so I can not use the docker, unfortunately.

Here is the steps I followed:

1) I asked the system administrator to install gdal libs as recommended in the documentation.

    sudo apt-get update
    sudo apt-get install gdal-bin libgdal-dev

These were correctly installed. By running

    gdalinfo --version 

I get: GDAL 3.0.4, released 2020/01/28

2) I created a conda environment with Python 3.7

   conda create -n rasterframes python==3.7
   conda activate rasterframes

3) I installed rasterframes using pip:

    my_conda_path/envs/rasterframes/bin/pip install pyrasterframes --no-cache-dir --force-reinstall

Here pyrasterframes tries to install gdal 2.4.4 as a dependency, but that does not work (I believe due to gdal 3.0.4?). I get an error:

error: command 'gcc' failed with exit status 1

4) I also tried to install gdal 2.4.4 using conda:

     conda install -c conda-forge gdal==2.4.4

That does not work either, due to some incompatible packages (not sure which ones, though): image

5) When I open a jupyter notebook and run:

    from pyrasterframes.utils import gdal_version 
    print(gdal_version()) 

I get: 'not available'

Is it possible to install rasterframes using the latest version of the gdal system libraries?

Thank you

vpipkt commented 3 years ago

@lalessan see #505 for details about our compatibility. You are correct right now 2.4.4 is required.

I would encourage you to remove the conda environment and try again, but do the conda install of gdal first so that it can use the conda channel priority stuff for all its dependencies.

$ conda create -n rasterframes python==3.7
$ conda activate rasterframes
(rasterframes) $ conda install -c conda-forge gdal==2.4.4
(rasterframes) $ pip install pyrasterframes==0.9.0
lalessan commented 3 years ago

Thank you, that has worked. For some reason I had to manually set the LD_LIBRARY_PATH to include gdal and dependencies located in the conda env folder.

vpipkt commented 3 years ago

okay @lalessan i will close this issue