Sentinelhub-py: libdeflate_zlib_decompress errors with TIFF

I am stuck with an error while following the sentinelhub-py documentation. The examples work fine when the response is of MimeType.PNG but in the basic Example 3 the MimeType changes to TIFF to layer the 13 bands.

This is when the code results in an error:

request_all_bands = SentinelHubRequest(
    evalscript=evalscript_all_bands,
    input_data=[
        SentinelHubRequest.input_data(
            data_collection=DataCollection.SENTINEL2_L1C,
            time_interval=("2020-06-01", "2020-06-30"),
            mosaicking_order=MosaickingOrder.LEAST_CC,
        )
    ],
    responses=[SentinelHubRequest.output_response("default", MimeType.TIFF)],
    bbox=betsiboka_bbox,
    size=betsiboka_size,
    config=config,
)

all_bands_response = request_all_bands.get_data()

DeflateError: libdeflate_zlib_decompress returned LIBDEFLATE_INSUFFICIENT_SPACE

I don’t see where in the sentinelhub code zlib is called or why I can’t output to a .TIFF file. Can someone guide me in the right direction? Thank you in advance

I’ve got an update and a solution.

The problem occurs when using Python 3.11 and sentinelhub Version: 3.9.0
There is no error when using Python 3.7.x and sentinelhub Version: 3.8.4

Hi @francode ,

We recommend using the latest sentinelhub python package. The sentinelhub python package currently supports python 3.8 | 3.9 | 3.10 (see documentation), which could be why you got an error when using python 3.11.

1 Like

Hello, I’m getting a similar error (shown below) when running the download client request:

data = SentinelHubDownloadClient(config=config).download(list_of_requests, max_threads=5)

Error:

DeflateError                              Traceback (most recent call last)
Cell In[94], line 3
      1 # download data with multiple threads - ndwi
      2 #data = SentinelHubDownloadClient(config=config).download(list_of_requests, max_threads=5)
----> 3 data = SentinelHubDownloadClient(config=config).download(list_of_requests)

File ~\AppData\Local\miniconda3\envs\sentinelhub\lib\site-packages\sentinelhub\download\sentinelhub_client.py:62, in SentinelHubDownloadClient.download(self, *args, **kwargs)
     60 self.lock = Lock()
     61 try:
---> 62     return super().download(*args, **kwargs)
     63 finally:
     64     self.lock = None

File ~\AppData\Local\miniconda3\envs\sentinelhub\lib\site-packages\sentinelhub\download\client.py:101, in DownloadClient.download(self, download_requests, max_threads, decode_data, show_progress)
     99 for future in as_completed(download_list):
    100     try:
--> 101         results[future_order[future]] = future.result()
    102     except DownloadFailedException as download_exception:
    103         if self.raise_download_errors:

File ~\AppData\Local\miniconda3\envs\sentinelhub\lib\concurrent\futures\_base.py:439, in Future.result(self, timeout)
    437     raise CancelledError()
    438 elif self._state == FINISHED:
--> 439     return self.__get_result()
    441 self._condition.wait(timeout)
    443 if self._state in [CANCELLED, CANCELLED_AND_NOTIFIED]:

File ~\AppData\Local\miniconda3\envs\sentinelhub\lib\concurrent\futures\_base.py:391, in Future.__get_result(self)
    389 if self._exception:
    390     try:
--> 391         raise self._exception
    392     finally:
    393         # Break a reference cycle with the exception in self._exception
    394         self = None

File ~\AppData\Local\miniconda3\envs\sentinelhub\lib\concurrent\futures\thread.py:58, in _WorkItem.run(self)
     55     return
     57 try:
---> 58     result = self.fn(*self.args, **self.kwargs)
     59 except BaseException as exc:
     60     self.future.set_exception(exc)

File ~\AppData\Local\miniconda3\envs\sentinelhub\lib\site-packages\sentinelhub\download\client.py:118, in DownloadClient._single_download_decoded(self, request)
    116 """Downloads a response and decodes it into data. By decoding a single response"""
    117 response = self._single_download(request)
--> 118 return None if response is None else response.decode()

File ~\AppData\Local\miniconda3\envs\sentinelhub\lib\site-packages\sentinelhub\download\models.py:246, in DownloadResponse.decode(self)
    244 def decode(self) -> Any:
    245     """Decodes binary data into a Python object."""
--> 246     return decode_data(self.content, data_type=self.response_type)

File ~\AppData\Local\miniconda3\envs\sentinelhub\lib\site-packages\sentinelhub\decoding.py:38, in decode_data(response_content, data_type)
     36     return decode_tar(response_content)
     37 if MimeType.is_image_format(data_type):
---> 38     return decode_image(response_content, data_type)
     39 if data_type is MimeType.XML or data_type is MimeType.GML or data_type is MimeType.SAFE:
     40     return ElementTree.fromstring(response_content)

File ~\AppData\Local\miniconda3\envs\sentinelhub\lib\site-packages\sentinelhub\decoding.py:63, in decode_image(data, image_type)
     61 bytes_data = BytesIO(data)
     62 if image_type is MimeType.TIFF:
---> 63     image = tiff.imread(bytes_data)
     64 elif image_type is MimeType.JP2:
     65     image = decode_jp2_image(bytes_data)

File ~\AppData\Local\miniconda3\envs\sentinelhub\lib\site-packages\tifffile\tifffile.py:784, in imread(files, aszarr, **kwargs)
    782             if aszarr:
    783                 return tif.aszarr(**kwargs)
--> 784             return tif.asarray(**kwargs)
    786 with TiffSequence(files, **kwargs_seq) as imseq:
    787     if aszarr:

File ~\AppData\Local\miniconda3\envs\sentinelhub\lib\site-packages\tifffile\tifffile.py:3119, in TiffFile.asarray(self, key, series, level, squeeze, out, maxworkers)
   3115         result = self.filehandle.read_array(
   3116             typecode, product(shape), out=out
   3117         )
   3118 elif len(pages) == 1:
-> 3119     result = pages[0].asarray(out=out, maxworkers=maxworkers)
   3120 else:
   3121     result = stack_pages(pages, out=out, maxworkers=maxworkers)

File ~\AppData\Local\miniconda3\envs\sentinelhub\lib\site-packages\tifffile\tifffile.py:6317, in TiffPage.asarray(self, out, squeeze, lock, maxworkers)
   6311         result[
   6312             s, d : d + shape[0], l : l + shape[1], w : w + shape[2]
   6313         ] = segment
   6314         # except IndexError:
   6315         #     pass  # corrupted files e.g. with too many strips
-> 6317     for _ in self.segments(
   6318         func=func,
   6319         lock=lock,
   6320         maxworkers=maxworkers,
   6321         sort=True,
   6322         _fullsize=False,
   6323     ):
   6324         pass
   6326 result.shape = keyframe.shaped

File ~\AppData\Local\miniconda3\envs\sentinelhub\lib\site-packages\tifffile\tifffile.py:6183, in TiffPage.segments(self, lock, maxworkers, func, sort, _fullsize)
   6175 with ThreadPoolExecutor(maxworkers) as executor:
   6176     for segments in fh.read_segments(
   6177         self.dataoffsets,
   6178         self.databytecounts,
   (...)
   6181         flat=False,
   6182     ):
-> 6183         yield from executor.map(decode, segments)

File ~\AppData\Local\miniconda3\envs\sentinelhub\lib\concurrent\futures\_base.py:609, in Executor.map.<locals>.result_iterator()
    606 while fs:
    607     # Careful not to keep a reference to the popped future
    608     if timeout is None:
--> 609         yield fs.pop().result()
    610     else:
    611         yield fs.pop().result(end_time - time.monotonic())

File ~\AppData\Local\miniconda3\envs\sentinelhub\lib\concurrent\futures\_base.py:439, in Future.result(self, timeout)
    437     raise CancelledError()
    438 elif self._state == FINISHED:
--> 439     return self.__get_result()
    441 self._condition.wait(timeout)
    443 if self._state in [CANCELLED, CANCELLED_AND_NOTIFIED]:

File ~\AppData\Local\miniconda3\envs\sentinelhub\lib\concurrent\futures\_base.py:391, in Future.__get_result(self)
    389 if self._exception:
    390     try:
--> 391         raise self._exception
    392     finally:
    393         # Break a reference cycle with the exception in self._exception
    394         self = None

File ~\AppData\Local\miniconda3\envs\sentinelhub\lib\concurrent\futures\thread.py:58, in _WorkItem.run(self)
     55     return
     57 try:
---> 58     result = self.fn(*self.args, **self.kwargs)
     59 except BaseException as exc:
     60     self.future.set_exception(exc)

File ~\AppData\Local\miniconda3\envs\sentinelhub\lib\site-packages\tifffile\tifffile.py:6155, in TiffPage.segments.<locals>.decode(args, decodeargs, keyframe, func)
   6154 def decode(args, decodeargs=decodeargs, keyframe=keyframe, func=func):
-> 6155     result = keyframe.decode(*args, **decodeargs)
   6156     if func is not None:
   6157         return func(result)

File ~\AppData\Local\miniconda3\envs\sentinelhub\lib\site-packages\tifffile\tifffile.py:6122, in TiffPage.decode.<locals>.decode(data, segmentindex, jpegtables, _fullsize)
   6119 if decompress is not None:
   6120     # TODO: calculate correct size for packed integers
   6121     size = shape[0] * shape[1] * shape[2] * shape[3]
-> 6122     data = decompress(data, out=size * dtype.itemsize)
   6123 data = unpack(data)
   6124 data = reshape(data, index, shape)

File imagecodecs\_deflate.pyx:222, in imagecodecs._deflate.deflate_decode()

DeflateError: libdeflate_zlib_decompress returned LIBDEFLATE_BAD_DATA
# download data with multiple threads - rgb
data_rgb = SentinelHubDownloadClient(config=config).download(list_of_requests_rgb, max_threads=5)

Hi @estep ,

Which version of sentinelhub are you using?

Hi there, thanks for your reply - it looks like I’m using 3.9.1
image

With Python version 3.9.16

Hi @estep ,

Great that’s the latest version. Could you please share your code so that I can reproduce the error?
Thank you!

Sure thing:

evalscript_ndwi= """
//VERSION=3
//NDWI

function setup() {
  return {
    input: [{
      bands: [
        "Green",
        "NIR"
      ]
    }],
    output: {
      bands: 1,
      sampleType: SampleType.FLOAT32
    }
  }
}
function evaluatePixel(samples) { 
let val = (samples.Green-samples.NIR)/(samples.Green+samples.NIR);
return [val]
}
"""
time_interval = dt.date(year=2021, month=6, day=16), dt.date(year=2023, month=5, day=7)

# Define the byoc
byoc = DataCollection.define_byoc(
collection_id=collection_id,
name=str(order_id),
is_timeless=False
)

def get_ndwi_request(time_interval):
    return SentinelHubRequest(
        evalscript=evalscript_ndwi, #Update eval if necessary
        input_data=[
            SentinelHubRequest.input_data(
                data_collection=byoc,
                time_interval=time_interval
            )
    ],
    responses=[SentinelHubRequest.output_response("default", MimeType.TIFF)],
    bbox=bbox,
    config=config,
    size=(500, 500)
    #resolution=(10,10)
)

# create a list of requests - ndwi
list_of_requests = [get_ndwi_request(image_date) for image_date in datestr_list]
list_of_requests = [request.download_list[0] for request in list_of_requests]

# download data with multiple threads - ndwi
data = SentinelHubDownloadClient(config=config).download(list_of_requests, max_threads=5)

Ultimately, I’m trying to plot the images in a facetted plot by date - let me know if there’s a workaround for plotting. This code worked previously (before I started getting the “DeflateError: libdeflate_zlib_decompress returned LIBDEFLATE_BAD_DATA” error). The only real changes that have been made to my machine since this worked last were updating/reinstalling miniconda and reinstalling ArcGIS Pro.

# Plotting ndwi
ncols = 5
nrows = 4
aspect_ratio = size[0] / size[1]
subplot_kw = {"xticks": [], "yticks": [], "frame_on": False}
cmap = 'YlGnBu'

fig, axs = plt.subplots(ncols=ncols, nrows=nrows, figsize=(4 * ncols * aspect_ratio, 5 * nrows), layout="constrained", subplot_kw=subplot_kw)

for idx, image in enumerate(data):
    ax = axs[idx // ncols][idx % ncols]
    im = ax.imshow(np.clip(image, -1, 1), cmap)
    ax.set_title(f"{datestr_list[idx][4:6]} - {datestr_list[idx][6:8]} - {datestr_list[idx][0:4]}", fontsize=16)

axins = inset_axes(
    ax,
    width="10%",  # % of parent_bbox width
    height="150%",
    #loc="upper left",
    bbox_to_anchor=(0.34, 3.75, 0.9, 0.8),
    bbox_transform=ax.transAxes,
    borderpad=0,
)

cbar = fig.colorbar(im, cax=axins)
tick_font_size=16
cbar.ax.tick_params(labelsize=tick_font_size)
    
plt.show()

Hi @estep, it seems that the issue you’re facing might be related to the versions of the packages you have installed. To help us troubleshoot the problem, could you please provide us with the output of the conda list command? This will give us a list of the packages you have installed, and allow us to identify the problematic packages.

Certainly!

(sentinelhub) F:\Projects\Mozambique_Pande\Sentinel-2 Analysis>conda list
# packages in environment at C:\Users\MLINDMAN\AppData\Local\miniconda3\envs\sentinelhub:
#
# Name                    Version                   Build  Channel
aenum                     3.1.12             pyhd8ed1ab_0    conda-forge
affine                    2.4.0                    pypi_0    pypi
aiofiles                  22.1.0           py39haa95532_0
aiosqlite                 0.18.0           py39haa95532_0
anyio                     3.5.0            py39haa95532_0
appdirs                   1.4.4              pyhd3eb1b0_0
argon2-cffi               21.3.0             pyhd3eb1b0_0
argon2-cffi-bindings      21.2.0           py39h2bbff1b_0
asttokens                 2.0.5              pyhd3eb1b0_0
attrs                     22.1.0           py39haa95532_0
babel                     2.11.0           py39haa95532_0
backcall                  0.2.0              pyhd3eb1b0_0
beautifulsoup4            4.12.2           py39haa95532_0
blas                      1.0                         mkl
bleach                    4.1.0              pyhd3eb1b0_0
blinker                   1.4              py39haa95532_0
blosc                     1.21.3               h6c2663c_0
boost-cpp                 1.73.0              h2bbff1b_12
boto3                     1.26.152           pyhd8ed1ab_0    conda-forge
botocore                  1.29.152           pyhd8ed1ab_0    conda-forge
bottleneck                1.3.5            py39h080aedc_0
branca                    0.6.0            py39haa95532_0
brotli                    1.0.9                h2bbff1b_7
brotli-bin                1.0.9                h2bbff1b_7
brotlipy                  0.7.0           py39h2bbff1b_1003
bzip2                     1.0.8                he774522_0
ca-certificates           2023.5.7             h56e8100_0    conda-forge
cairo                     1.16.0               haedb8bc_4
certifi                   2023.5.7           pyhd8ed1ab_0    conda-forge
cffi                      1.15.1           py39h2bbff1b_3
cfitsio                   3.470                h2bbff1b_7
charls                    2.2.0                h6c2663c_0
charset-normalizer        2.0.4              pyhd3eb1b0_0
click                     8.0.4            py39haa95532_0
click-plugins             1.1.1              pyhd3eb1b0_0
cligj                     0.7.2            py39haa95532_0
colorama                  0.4.6            py39haa95532_0
comm                      0.1.2            py39haa95532_0
contourpy                 1.0.5            py39h59b6b97_0
cryptography              39.0.1           py39h21b164f_0
curl                      7.88.1               h2bbff1b_1
cycler                    0.11.0             pyhd3eb1b0_0
dataclasses-json          0.5.7              pyhd8ed1ab_0    conda-forge
debugpy                   1.5.1            py39hd77b12b_0
decorator                 5.1.1              pyhd3eb1b0_0
defusedxml                0.7.1              pyhd3eb1b0_0
editables                 0.3                pyhd8ed1ab_0    conda-forge
entrypoints               0.4              py39haa95532_0
executing                 0.8.3              pyhd3eb1b0_0
expat                     2.4.9                h6c2663c_0
fiona                     1.9.1            py39hf11a4ad_0
folium                    0.14.0           py39haa95532_0
fontconfig                2.14.1               h9c4af85_2
fonttools                 4.25.0             pyhd3eb1b0_0
freetype                  2.12.1               ha860e81_0
freexl                    1.0.6                h2bbff1b_0
gdal                      3.6.2            py39h9eae49a_1
geopandas                 0.12.2           py39haa95532_0
geopandas-base            0.12.2           py39haa95532_0
geos                      3.8.0                h33f27b4_0
geotiff                   1.7.0                h4545760_1
giflib                    5.2.1                h8cc25b3_3
glib                      2.69.1               h5dc1a3c_2
gst-plugins-base          1.18.5               h9e645db_0
gstreamer                 1.18.5               hd78058f_0
hatchling                 1.18.0             pyhd8ed1ab_0    conda-forge
hdf4                      4.2.13               h712560f_2
hdf5                      1.10.6               h1756f20_1
icc_rt                    2022.1.0             h6049295_2
icu                       58.2                 ha925a31_3
idna                      3.4              py39haa95532_0
imagecodecs               2021.8.26        py39h319e4f4_2
importlib-metadata        6.0.0            py39haa95532_0
importlib_metadata        6.0.0                hd3eb1b0_0
importlib_resources       5.2.0              pyhd3eb1b0_1
intel-openmp              2023.1.0         h59b6b97_46319
ipykernel                 6.19.2           py39hd4e2768_0
ipython                   8.12.0           py39haa95532_0
ipython_genutils          0.2.0              pyhd3eb1b0_1
ipywidgets                8.0.6              pyhd8ed1ab_0    conda-forge
jedi                      0.18.1           py39haa95532_1
jinja2                    3.1.2            py39haa95532_0
jmespath                  1.0.1              pyhd8ed1ab_0    conda-forge
joblib                    1.2.0            py39haa95532_0
jpeg                      9e                   h2bbff1b_1
json5                     0.9.6              pyhd3eb1b0_0
jsonschema                4.17.3           py39haa95532_0
jupyter_client            8.1.0            py39haa95532_0
jupyter_core              5.3.0            py39haa95532_0
jupyter_events            0.6.3            py39haa95532_0
jupyter_server            2.5.0            py39haa95532_0
jupyter_server_fileid     0.9.0            py39haa95532_0
jupyter_server_terminals  0.4.4            py39haa95532_0
jupyter_server_ydoc       0.8.0            py39haa95532_0
jupyter_ydoc              0.2.4            py39haa95532_0
jupyterlab                3.6.3            py39haa95532_0
jupyterlab_pygments       0.1.2                      py_0
jupyterlab_server         2.22.0           py39haa95532_0
jupyterlab_widgets        3.0.7              pyhd8ed1ab_1    conda-forge
jxrlib                    1.1                  h8ffe710_2    conda-forge
kealib                    1.5.0                hde4a422_0
kiwisolver                1.4.4            py39hd77b12b_0
krb5                      1.19.4               h5b6d351_0
lcms2                     2.12                 h83e58a3_0
lerc                      3.0                  hd77b12b_0
libaec                    1.0.6                h39d44d4_0    conda-forge
libboost                  1.73.0              h6c2663c_12
libbrotlicommon           1.0.9                h2bbff1b_7
libbrotlidec              1.0.9                h2bbff1b_7
libbrotlienc              1.0.9                h2bbff1b_7
libclang                  14.0.6          default_hb5a9fac_1
libclang13                14.0.6          default_h8e68704_1
libcurl                   7.88.1               h86230a5_1
libdeflate                1.17                 h2bbff1b_0
libffi                    3.4.4                hd77b12b_0
libgdal                   3.6.2                h11d7215_1
libiconv                  1.16                 h2bbff1b_2
libkml                    1.3.0                h63940dd_6
libnetcdf                 4.8.1                h6685c40_2
libogg                    1.3.5                h2bbff1b_1
libpng                    1.6.39               h8cc25b3_0
libpq                     12.9                 hb652d5d_3
libsodium                 1.0.18               h62dcd97_0
libspatialindex           1.9.3                h6c2663c_0
libspatialite             4.3.0a              h6ec8781_23
libssh2                   1.10.0               hcd4344a_0
libtiff                   4.5.0                h6c2663c_2
libvorbis                 1.3.7                he774522_0
libwebp                   1.2.4                hbc33d0d_1
libwebp-base              1.2.4                h2bbff1b_1
libxml2                   2.10.3               h0ad7f3c_0
libxslt                   1.1.37               h2bbff1b_0
libzip                    1.8.0                h49b8836_0
libzopfli                 1.0.3                h0e60522_0    conda-forge
lxml                      4.9.2            py39h2bbff1b_0
lz4-c                     1.9.4                h2bbff1b_0
mapclassify               2.5.0            py39haa95532_0
markupsafe                2.1.1            py39h2bbff1b_0
marshmallow               3.19.0             pyhd8ed1ab_0    conda-forge
marshmallow-enum          1.5.1              pyh9f0ad1d_3    conda-forge
matplotlib                3.7.1            py39hcbf5309_0    conda-forge
matplotlib-base           3.7.1            py39hf11a4ad_1
matplotlib-inline         0.1.6            py39haa95532_0
mistune                   0.8.4           py39h2bbff1b_1000
mkl                       2023.1.0         h8bd8f75_46356
mkl-service               2.4.0            py39h2bbff1b_1
mkl_fft                   1.3.6            py39hf11a4ad_1
mkl_random                1.2.2            py39hf11a4ad_1
munch                     2.5.0              pyhd3eb1b0_0
munkres                   1.1.4                      py_0
mypy_extensions           1.0.0              pyha770c72_0    conda-forge
nbclassic                 0.5.5            py39haa95532_0
nbclient                  0.5.13           py39haa95532_0
nbconvert                 6.5.4            py39haa95532_0
nbformat                  5.7.0            py39haa95532_0
nest-asyncio              1.5.6            py39haa95532_0
networkx                  2.8.4            py39haa95532_1
notebook                  6.3.0            py39hcbf5309_0    conda-forge
notebook-shim             0.2.2            py39haa95532_0
numexpr                   2.8.4            py39h7b80656_1
numpy                     1.24.3           py39h79a8e48_1
numpy-base                1.24.3           py39h8a87ada_1
oauthlib                  3.2.2              pyhd8ed1ab_0    conda-forge
openjpeg                  2.4.0                h4fc8c34_0
openssl                   1.1.1t               h2bbff1b_0
packaging                 23.0             py39haa95532_0
pandas                    1.5.2            py39hf11a4ad_0    anaconda
pandocfilters             1.5.0              pyhd3eb1b0_0
parso                     0.8.3              pyhd3eb1b0_0
pathspec                  0.11.1             pyhd8ed1ab_0    conda-forge
pcre                      8.45                 hd77b12b_0
pcre2                     10.37                h0ff8eda_1
pickleshare               0.7.5           pyhd3eb1b0_1003
pillow                    9.4.0            py39hd77b12b_0
pip                       23.1.2           py39haa95532_0
pixman                    0.40.0               h2bbff1b_1
platformdirs              2.5.2            py39haa95532_0
pluggy                    1.0.0              pyhd8ed1ab_5    conda-forge
ply                       3.11             py39haa95532_0
pooch                     1.4.0              pyhd3eb1b0_0
poppler                   22.12.0              h268424c_0
poppler-data              0.4.11               haa95532_1
postgresql                12.9                 hb652d5d_3
proj                      6.2.1                h3758d61_0
prometheus_client         0.14.1           py39haa95532_0
prompt-toolkit            3.0.36           py39haa95532_0
psutil                    5.9.0            py39h2bbff1b_0
pure_eval                 0.2.2              pyhd3eb1b0_0
pycparser                 2.21               pyhd3eb1b0_0
pygments                  2.15.1           py39haa95532_1
pyjwt                     2.4.0            py39haa95532_0
pyopenssl                 23.0.0           py39haa95532_0
pyparsing                 3.0.9            py39haa95532_0
pyproj                    2.6.1.post1      py39h593ac45_1
pyqt                      5.15.7           py39hd77b12b_0
pyqt5-sip                 12.11.0          py39hd77b12b_0
pyrsistent                0.18.0           py39h196d8e1_0
pysocks                   1.7.1            py39haa95532_0
python                    3.9.16               h6244533_2
python-dateutil           2.8.2              pyhd3eb1b0_0
python-fastjsonschema     2.16.2           py39haa95532_0
python-json-logger        2.0.7            py39haa95532_0
python_abi                3.9                      2_cp39    conda-forge
pytz                      2022.7           py39haa95532_0
pywin32                   305              py39h2bbff1b_0
pywinpty                  2.0.10           py39h5da7b33_0
pyyaml                    6.0              py39h2bbff1b_1
pyzmq                     25.1.0           py39hd77b12b_0
qhull                     2020.2               h59b6b97_2
qt-main                   5.15.2               he8e5bd7_8
qt-webengine              5.15.9               hb9a9bb5_5
qtwebkit                  5.212                h2bbfb41_5
rasterio                  1.3.7                    pypi_0    pypi
requests                  2.29.0           py39haa95532_0
requests-oauthlib         1.3.1              pyhd8ed1ab_0    conda-forge
rfc3339-validator         0.1.4            py39haa95532_0
rfc3986-validator         0.1.1            py39haa95532_0
rtree                     1.0.1            py39h2eaa2aa_0
s3transfer                0.6.1              pyhd8ed1ab_0    conda-forge
scikit-learn              1.2.2            py39hd77b12b_1
scipy                     1.10.1           py39hdcfc7df_1
send2trash                1.8.0              pyhd3eb1b0_1
sentinelhub               3.9.1              pyhd8ed1ab_0    conda-forge
setuptools                67.8.0           py39haa95532_0
shapely                   1.8.2                    pypi_0    pypi
sip                       6.6.2            py39hd77b12b_0
six                       1.16.0             pyhd3eb1b0_1
snappy                    1.1.9                h6c2663c_0
sniffio                   1.2.0            py39haa95532_1
snuggs                    1.4.7                    pypi_0    pypi
soupsieve                 2.4              py39haa95532_0
sqlite                    3.41.2               h2bbff1b_0
stack_data                0.2.0              pyhd3eb1b0_0
stringcase                1.2.0                      py_0    conda-forge
tbb                       2021.8.0             h59b6b97_0
terminado                 0.17.1           py39haa95532_0
threadpoolctl             2.2.0              pyh0d69192_0
tifffile                  2021.4.8           pyhd8ed1ab_0    conda-forge
tiledb                    2.3.3                h3649cd2_2
tinycss2                  1.2.1            py39haa95532_0
tk                        8.6.12               h2bbff1b_0
toml                      0.10.2             pyhd3eb1b0_0
tomli                     2.0.1            py39haa95532_0
tomli-w                   1.0.0              pyhd8ed1ab_0    conda-forge
tornado                   6.2              py39h2bbff1b_0
tqdm                      4.65.0             pyhd8ed1ab_1    conda-forge
traitlets                 5.7.1            py39haa95532_0
trove-classifiers         2023.5.24          pyhd8ed1ab_0    conda-forge
typing-extensions         4.6.3            py39haa95532_0
typing_extensions         4.6.3            py39haa95532_0
typing_inspect            0.9.0              pyhd8ed1ab_0    conda-forge
tzdata                    2023c                h04d1e81_0
urllib3                   1.26.16          py39haa95532_0
utm                       0.7.0              pyhd8ed1ab_0    conda-forge
vc                        14.2                 h21ff451_1
vs2015_runtime            14.27.29016          h5e58377_2
wcwidth                   0.2.5              pyhd3eb1b0_0
webencodings              0.5.1            py39haa95532_1
websocket-client          0.58.0           py39haa95532_4
wheel                     0.38.4           py39haa95532_0
widgetsnbextension        4.0.7              pyhd8ed1ab_0    conda-forge
win_inet_pton             1.1.0            py39haa95532_0
winpty                    0.4.3                         4
xerces-c                  3.2.4                hd77b12b_0
xyzservices               2022.9.0         py39haa95532_1
xz                        5.4.2                h8cc25b3_0
y-py                      0.5.9            py39hb6bf4ef_0
yaml                      0.2.5                he774522_0
ypy-websocket             0.8.2            py39haa95532_0
zeromq                    4.3.4                hd77b12b_0
zfp                       0.5.5                h0e60522_8    conda-forge
zipp                      3.11.0           py39haa95532_0
zlib                      1.2.13               h8cc25b3_0
zstd                      1.5.5                hd43e919_0

(sentinelhub) F:\Projects\Mozambique_Pande\Sentinel-2 Analysis>

Hi there,
I would definitely still appreciate any feedback you may have on packages/versions, but my deflate error appears to be resolved for now. I uninstalled Miniconda and installed Anaconda, then setup a fresh environment and installed SentinelHub again.

Hi Emilia,

Apologies for the lack of reply. We are finding it difficult to replicate the library issues that you have been experiencing. Once, we have found a solution we will update the thread. :+1: However, good to hear that your deflate error is resolved for now. :slight_smile:

Hello,

I am using python version 3.11.5 and sentinelhub version 3.10.2. I encounter the following error:
DeflateError: libdeflate_zlib_decompress returned LIBDEFLATE_BAD_DATA

For this piece of code (Note that the code works when calling 3 bands only):

evalscript_all_bands = """
    //VERSION=3
    function setup() {
        return {
            input: [{
                bands: ["B01","B02","B03","B04","B05","B06","B07","B08","B8A","B09","B10","B11","B12"],
                units: "DN"
            }],
            output: {
                bands: 13,
                sampleType: "INT16"
            }
        };
    }

    function evaluatePixel(sample) {
        return [sample.B01,
                sample.B02,
                sample.B03,
                sample.B04,
                sample.B05,
                sample.B06,
                sample.B07,
                sample.B08,
                sample.B8A,
                sample.B09,
                sample.B10,
                sample.B11,
                sample.B12];
    }
"""

request_all_bands = SentinelHubRequest(
    evalscript=evalscript_all_bands,
    input_data=[
        SentinelHubRequest.input_data(
            data_collection=DataCollection.SENTINEL2_L1C,
            time_interval=('2023-12-25', '2024-01-22'),
            mosaicking_order='leastCC'
    )],
    responses=[
        SentinelHubRequest.output_response("default", MimeType.TIFF)
    ],
    bbox=site_1_bbox,
    size=site_1_size,
    config=config,
)

all_bands_response = request_all_bands.get_data()

Any help would be appreciated!

Hello I’d like to know if you have solved this problem? I meet this problem as well.

My python version is 3.11.5 and sentinel hub version is 3.10.2

Yep, just downgrade your python version temporarily. I used Colab to downgrade the python version then run my code.

1 Like