umr-lops / xsar

Synthetic Aperture Radar (SAR) Level-1 GRD python mapper for efficient xarray/dask based processing
https://cyclobs.ifremer.fr/static/sarwing_datarmor/xsar/
MIT License
28 stars 8 forks source link

installation fail #135

Closed trgy1 closed 1 year ago

trgy1 commented 1 year ago

I have tried to download xsar packages and requirements directly. using conda install -c conda-forge xsar. Python version 3.8. I have also tried to download from requirements with: pip install -r https://raw.githubusercontent.com/umr-lops/xsar/develop/requirements.txt got the error related GDAL. When I tried to force installation with sudo apt-get install libgdal-dev, it still doesnt recognise the module.

What else can I can try please?

agrouaze commented 1 year ago

Hi, you can try 2 things: 1) make sure your conda is up to date conda update conda 2) install rasterio and geopandas before anything else: conda install rasterio geopandas conda install xsar (tested successfuly few minutes ago on Ubuntu 22.04.1 LTS).

conda install xsar
Collecting package metadata (current_repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Solving environment: failed with repodata from current_repodata.json, will retry with next repodata source.
Collecting package metadata (repodata.json): done
Solving environment: done
...
Preparing transaction: done                                                                                                                                                                                   
Verifying transaction: done                                                                                                                                                                                   
Executing transaction: done 

Which OS are you using? The auto build are OK on all systems accept for version python 3.11 numba not yet supported)

agrouaze commented 1 year ago

I close this issue, do not hesitate to open again if needed.

jthetzel commented 11 months ago

I am using poetry and was seeing this error after poetry add xsar:

      In file included from /home/jthetzel/.pyenv/versions/3.10.13/include/python3.10/Python.h:130,
                       from extensions/gdal_wrap.cpp:180:
      /home/jthetzel/.pyenv/versions/3.10.13/include/python3.10/ceval.h:122:37: note: declared here
        122 | Py_DEPRECATED(3.9) PyAPI_FUNC(void) PyEval_InitThreads(void);
            |                                     ^~~~~~~~~~~~~~~~~~
      error: command '/usr/bin/gcc' failed with exit code 1
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for GDAL
  Running setup.py clean for GDAL
Failed to build GDAL
ERROR: Could not build wheels for GDAL, which is required to install pyproject.toml-based projects

Following a hint from https://stackoverflow.com/questions/38630474/error-while-installing-gdal#comment70408136_38630941 , I tried:

poetry add GDAL==$(gdal-config --version | awk -F'[.]' '{print $1"."$2}')

Followed by:

poetry add xsar

And it works! 🎉