Closed howardvanmeer closed 9 months ago
Dear Howard,
Could you please check what is returned when you try: reticulate::import("cdsapi")
Also, could you please share the code where you call the ag5_download()
function?
Thanks,
David
Just the example from your paper about the tool library(ag5Tools) ag5_download(variable = "2m_temperature", statistic = "day_time_maximum", day = "all", month = "all", year = 2000:2005, path = "C:/Users/meer164/Downloads/ERA5/") I get: reticulate::import("cdsapi")
It should return Module(cdsapi)
, I think.
Please post what reticulate::conda_list()
returns.
retiulate::conda_list() gives: I made an environment called "wk_ecmwf" following all the steps mentioned on copernicus webpage reticulate::conda_list() name python 1 base C:\Users\meer164\AppData\Local\anaconda3/python.exe 2 wk_ecmwf C:\Users\meer164\AppData\Local\anaconda3\envs\wk_ecmwf/python.exe
I'm sure you already installed cdsapi but could you please check if it works after trying this:
reticulate::conda_install("wk_ecmwf", "cdsapi")
still giving same error. .cdsapirc file with URL and key is in user/meer164 directory. What else could there be wrong?
Dear David,
I saw you did your PhD at Wageningen University. If we don't manage through these messages, do you think there is someone here at WUR to help me out?
Howard
Hi Howard,
I think it could be related to reticulate. Could you please try: 1) Re-install reticulate 2) Re-install cdsapi using reticulate::conda_install(packages = "cdsapi")
I know you created the wk_ecmwf environment for a reason, but perhaps using the r-reticulate default environment would work, which I don't see in your list of environments.
If reticulate/python and the cdsapi are ok you should be able to run this, regardless of ag5tools:
library(reticulate)
cdsapi <- reticulate::import("cdsapi")
c <- cdsapi$Client()
c$retrieve(
'sis-agrometeorological-indicators',
list("version" = "1_1",
"format" = "zip",
"variable" = "precipitation_flux",
"year" = "1979",
"month" = "01",
"day" = "01"),
"download.zip")
Please let me know if that works.
I cannot refer to someone in specific at WUR but basically anyone with experience using reticulate could help, I think.
Thanks, David
Hello David,
Now it worked!!! there was some conflict with reticulate. Thank you very much!!! Please take care
Kind regards Howard
Great, thanks for letting me know.
Best,
David
Dear David, I am a PhD student at Wagenen University, I came across your Ag5tools Package. I followed all the steps but a get this error massage when I call download function.
Error in cdsapi$Client() : attempt to apply non-function
session_python gives following info python: C:/Users/meer164/AppData/Local/anaconda3/envs/wk_ecmwf/python.exe libpython: C:/Users/meer164/AppData/Local/anaconda3/envs/wk_ecmwf/python36.dll pythonhome: C:/Users/meer164/AppData/Local/anaconda3/envs/wk_ecmwf version: 3.6.15 (default, Dec 3 2021, 18:25:24) [MSC v.1916 64 bit (AMD64)] Architecture: 64bit numpy: C:/Users/meer164/AppData/Local/anaconda3/envs/wk_ecmwf/Lib/site-packages/numpy numpy_version: 1.19.5 cdsapi: C:\Users\meer164\AppData\Local\ANACON~1\envs\wk_ecmwf\lib\site-packages\cdsapi__init__.p
NOTE: Python version was forced by RETICULATE_PYTHON
Can you please help me out? Thanks in advance
Howard van Meer