WRADLIB_DATA' environment variable not set

Dear Support Team,

I hope this email finds you well. I am writing to inform you of an error that I encountered while using your software. I have recently installed the WRADLIB library and while trying to run the program, I received the following error message:

“WRADLIB_DATA environment variable not set”

I am not sure what this error means and how to resolve it. I would appreciate if you could provide some guidance on how to resolve this issue.

Additionally, please let me know if there is any further information that you require from me to assist in resolving this error.

Thank you for your time and assistance. I look forward to hearing back from you.

Best regards,
Bukya Sama

You can either comment out this line like # wrl_data_path = os.environ.get("WRADLIB_DATA", None)
or you can clone “WRADLIB_DATA” from GitHub by running the following command in the terminal or command prompt:
git clone https://github.com/wradlib/wradlib-data.git,
and set an environment variable.
Or you can also do something like this after cloning the repo:

import wradlib as wrl
import os
os.environ["WRADLIB_DATA"] = "path\to\cloned\repository\"

@SAMA I’m adding a bit of context here. If you are working with radar data of your own and not using the example data provided in wradlib-data you can completely drop the usage of WRADLIB_DATA and the helper functions wradlib.util.get_wradlib_data_path/wradlib.util.get_wradlib_data_file.

These functions are used to get the path for the directory where the wradlib-data is installed, which should be given in WRADLIB_DATA env var. It is normally used in wradlib testing framework as well as in the creation of the wradlib-notebooks.

So for your example (screenshots are very nice, but a text snippet of the code you are running would be better for copy&pasting) you just would do as @syedhamidali suggested already:

import wradlib as wrl

print(wrl.__version__)
fpath = "/media/user/workBench/dwr_mosdac/RCTLS_24JUN2021_051159_L2B_STD.nc"
outdict = wrl.io.read_generic_netcdf(fpath)
for key in outdict.keys():
    print(key)

Just as a heads-up for those who are using the wradlib-data. We are moving the wradlib-data repo to use pooch to retrieve the data without pre-installing. This works along the lines of other data-packages donwloading data on first request and storing into user space (eg. under .cache on Linux).