UMEP-dev / UMEP

Urban Multi-scale Environmental Predictor
https://umep-docs.readthedocs.io/
59 stars 15 forks source link

Download data (ERA5) AttributeError: 'NoneType' object has no attribute 'write' #600

Closed CDelasse closed 3 months ago

CDelasse commented 3 months ago

I followed the steps in this guide : https://confluence.ecmwf.int/display/CKB/How+to+install+and+use+CDS+API+on+Windows The configuration file works but now I get this error : { 'CRS' : QgsCoordinateReferenceSystem('EPSG:3007'), 'DATEINIEND' : '2000-01-02T00:00:00', 'DATEINISTART' : '2000-01-01T00:00:00', 'DIAG_HEIGHT' : 100, 'INPUT_POINT' : '147839.864321,6398730.165207 [EPSG:3007]', 'OUTPUT_DIR' : 'C:\Users\cdelasse01\Documents\meteo' }

SuPy version: 2023.5.26.dev0 INPUT PARAMETERS: lat = 57.70771659556899 lon = 11.963764573395377 Start = 2000-01-01T00:00:00 End = 2000-01-02T00:00:00 Diagnostic height = 100.0 Output folder = C:\Users\cdelasse01\Documents\meteo Traceback (most recent call last): File "C:\Users/cdelasse01/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\processing_umep\preprocessor\copernicusera5_algorithm.py", line 182, in processAlgorithm sp.util.gen_forcing_era5(lat, lon, startDate, endDate, hgt_agl_diag=diagHeight, dir_save=Path(outputDir)) File "C:\Users\cdelasse01\AppData\Roaming\Python\Python39\site-packages\supy\util_era5.py", line 733, in gen_forcing_era5 list_fn_sfc, list_fn_ml = load_filelist_era5( File "C:\Users\cdelasse01\AppData\Roaming\Python\Python39\site-packages\supy\util_era5.py", line 627, in load_filelist_era5 download_era5( File "C:\Users\cdelasse01\AppData\Roaming\Python\Python39\site-packages\supy\util_era5.py", line 523, in download_era5 download_cds(path_dir_save / fn_sfc, dict_req) File "C:\Users\cdelasse01\AppData\Roaming\Python\Python39\site-packages\supy\util_era5.py", line 455, in download_cds c.retrieve(*dict_req) File "C:\Users\cdelasse01\AppData\Roaming\Python\Python39\site-packages\cdsapi\api.py", line 312, in retrieve result.download(target) File "C:\Users\cdelasse01\AppData\Roaming\Python\Python39\site-packages\cdsapi\api.py", line 165, in download return self._download(self.location, File "C:\Users\cdelasse01\AppData\Roaming\Python\Python39\site-packages\cdsapi\api.py", line 120, in _download with tqdm(total=size, File "C:\Users\cdelasse01\AppData\Roaming\Python\Python39\site-packages\tqdm\std.py", line 1098, in init self.refresh(lock_args=self.lock_args) File "C:\Users\cdelasse01\AppData\Roaming\Python\Python39\site-packages\tqdm\std.py", line 1347, in refresh self.display() File "C:\Users\cdelasse01\AppData\Roaming\Python\Python39\site-packages\tqdm\std.py", line 1495, in display self.sp(self.str() if msg is None else msg) File "C:\Users\cdelasse01\AppData\Roaming\Python\Python39\site-packages\tqdm\std.py", line 459, in print_status fp_write('\r' + s + (' ' max(last_len[0] - len_s, 0))) File "C:\Users\cdelasse01\AppData\Roaming\Python\Python39\site-packages\tqdm\std.py", line 452, in fp_write fp.write(str(s)) File "C:\Users\cdelasse01\AppData\Roaming\Python\Python39\site-packages\tqdm\utils.py", line 140, in getattr return getattr(self._wrapped, name) AttributeError: 'NoneType' object has no attribute 'write'

Execution failed after 50.07 secondes

biglimp commented 3 months ago

I just tried and it worked for me. Open the Python Console before you execute the tool Then you see more in detail what happens.

CDelasse commented 3 months ago

It works now thanks.