Skip to main content

AttributeError: LANDSAT_TM_L1

  • April 17, 2024
  • 9 replies
  • 0 views

I am using Windows 7 64-bit version and Python 3.8.
I get an error while executing the example:

" Measuring the water level of a Theewaterskloof Dam in South Africa".
Error is:


AttributeError Traceback (most recent call last)
~\AppData\Local\Temp/ipykernel_3756/1149534225.py in
----> 1 download_task = SentinelHubInputTask(
2 data_collection=DataCollection.SENTINEL2_L1C,
3 bands_feature=(FeatureType.DATA, ‘BANDS’),
4 resolution=20,
5 maxcc=0.5,

C:\ProgramData\Miniconda3\lib\site-packages\eolearn\io\sentinelhub_process.py in init(self, data_collection, size, resolution, bands_feature, bands, additional_data, evalscript, maxcc, time_difference, cache_folder, max_threads, config, bands_dtype, single_scene, mosaicking_order, aux_request_args, data_source)
430 if not bands:
431 bands = self.data_collection.bands
→ 432 self._add_request_bands(self.requested_bands, bands)
433
434 if additional_data is not None:

C:\ProgramData\Miniconda3\lib\site-packages\eolearn\io\sentinelhub_process.py in _add_request_bands(self, request_dict, added_bands)
440 def _add_request_bands(self, request_dict, added_bands):
441 handfixed_collections = [
→ 442 DataCollection.LANDSAT_TM_L1, DataCollection.LANDSAT_TM_L2,
443 DataCollection.LANDSAT_ETM_L1, DataCollection.LANDSAT_ETM_L2,
444 DataCollection.LANDSAT_OT_L1, DataCollection.LANDSAT_OT_L2,

C:\ProgramData\Miniconda3\lib\enum.py in getattr(cls, name)
382 return cls.member_map[name]
383 except KeyError:
→ 384 raise AttributeError(name) from None
385
386 def getitem(cls, name):

AttributeError: LANDSAT_TM_L1

9 replies

Hi @behzadsarhadi,

Please upgrade your version of sentinelhub package. The missing enum DataCollection.LANDSAT_TM_L1 was added in package version 3.4.0. I also recommend upgrading eo-learn to the latest version.


Hm, it works fine for me. Therefore I still suspect an older package version. Could you try:

from sentinelhub import __version__
print(__version__)

Executing the following code encounters the error mentioned above. Is the cause due to settings AWS?

from sentinelhub import DataCollection
test = DataCollection.LANDSAT_TM_L1


tanx for your reply but i use 3.4.1 version of it


I updated directly from github. And the following message was displayed:

successfully installed sentinelhub-3.4.1.

But executing the print command shows the same version 3.2.1
The pip list command also shows the sentinelhub version 3.4.1. And I still get the same error.


tanx for your help.
The following result was obtained:
3.2.1

how can i upgrade it? The following command do not work:

pip install sentinelhub --upgrade

and “all requested packages already installed” is shown


The problem was solved by updating the package. In the update, only the following command worked:

pip install path --upgrade

Where path was the sentinelhub zip file downloaded from GitHub on my computer. After manually clearing the site-package of Python env after uninstalling the package!


I use conda, but the conda list also shows the 3.4.1 package version.


Is it possible that you upgraded the package in one Python environment but are running the code in another environment?