I probably have to export some PATH-s for my conda environment, but I am totally out of clue what I have to do specifically. Maybe anyone have more recent experience how to solve it. Thanks!
Wradlib version 2.0.3.
@jorahu Unfortunately I do not have a better advise. I get this type of error every once in a while, but can’t exactly pinpoint the source. I
I’m thinking something is fishy with the PROJ/GDAL conda-env vars. Those might not get set, if the conda environment is not correctly activate. This happens if you just run the python kernel via some IDE or the like. You might check which environment variables are set in the environment after activation.
Thanks Kai! This has been really helpful actually.
The problem is really how I have set up my envs within Jupyterlab. When I activate env and use the “env” command I could also see the GDAL_DATA and PROJ_DATA but not PROJ_LIB that caused the error.
The following would set the PROJ_LIB permanently to the env: conda env config vars set PROJ_LIB='/home/jorma/anaconda3/envs/steps4/share/proj' -n steps4
But… I have installed all the envs to Jupyterlab with ipykernel, and when I run “env” from some notebook with the same env, a lot of environment variables are missing, including both GDAL_DATA and PROJ_DATA, not to mentions PROJ_LIB.
Only when I manually change the variables through os.environ then the variables are added to the env.
import os
os.environ['PROJ_LIB'] = '/home/jorma/anaconda3/envs/steps4/share/proj'
This turned out to be much more complicated than I would have hoped… Need to look into installing the envs to jupyterlab with ipykernel so that it would grab all the environment variables in the process.
Now all available conda environments (which have ipykernel installed) are available from jupyterlab (in jupyterlab environment). And (big point) the environments will be properly activated. Could you please check, if this works for you too?
I am hosting jupyterlab from base, so all I had to do was install nb_conda_kernels to base. I had ipykernel installed in all other envs. And now totally different options appeared with kernel selection:
And now, yes, the environment variables are all included → the env is now “correctly” activated within jupyterlab.
I have always looked away from nb_conda_kernels for some reason… never knew what it did. But apparently it is more than important. In short, the env hosting jupyterlab (can be base) needs nb_conda_kernels installed and all other envs need ipykernel installed.
Thanks a lot, Kai, for looking into it and solving the issue for me! Not wradlib related but rather how my Jupyterlab was set up.