mathworks / climatedatastore

Climate Data Store Toolbox for MATLAB
Other
37 stars 10 forks source link

Unable to resolve the name 'cdsapi_Factory.getCdsapi'. #11

Closed FlorinZai closed 1 year ago

FlorinZai commented 1 year ago

Thank you for the toolbox it could be very useful for me. I am having issues in running the example. I installed Python3.8 and it shows up in Matlab. The CDS API seems to be installed. Running Matlab 2022b

Unable to resolve the name 'cdsapi_Factory.getCdsapi'.

Error in climateDataStoreDownloadFuture (line 88) obj.CdsapiClient = cdsapi_Factory.getCdsapi(options);

Error in climateDataStoreDownload (line 50) f = climateDataStoreDownloadFuture(datasetName, datasetOptions,options);

onomitra commented 1 year ago

It doesn't look like "cdsapi_Factory" or the "util" folder is on path when the toolbox gets installed.

rpurser47 commented 1 year ago

Yep – looks like the toolbox packaging step is not adding util and doc to the MATLAB path. -Rob

rpurser47 commented 1 year ago

@FlorinZai, please try out the latest release to see if that fixes the issue. Thank you for reporting this!

FlorinZai commented 1 year ago

@rpurser47 Thanks! Now it works, but I still had to add the C:\Users\USERNAME folder path to find the .cdsapirc file with the API key. Good job with developing this toolbox, very handy!

rpurser47 commented 1 year ago

Just to make sure that I understand, you had to add the folder with the .cdsapirc to the MATLAB path? Or the Windows path?

FlorinZai commented 1 year ago

@rpurser47 Adding it to windows path did nothing. Strangely I need to be located in C:\Users\USERNAME with Matlab for it to work. Turned out that adding it to path wasn't enough.

This is the error: Error using setupCDSAPIIfNeeded Cannot create a credential file (\Users\flory\.cdsapirc). No such file or directory

rpurser47 commented 1 year ago

HI @FlorinZai , do you mind breaking this out into a new issue?

FlorinZai commented 1 year ago

@rpurser47 done. Thanks!