it installs but then the blog post notebook doesn’t run and fails when importing pandas
import pandas
ImportError: cannot import name 'DtypeArg' from 'pandas._typing' (/home/rave/miniconda3/envs/condaenv/lib/python3.9/site-packages/pandas/_typing.py)
also, xarray-spatial is not included in the environment but it is used in the blog post notebook. installing xarray-spatial after the fact downgrades pytorch to use the cpu version, so it needs to be included to be able to run the blog post notebook locally.
I had to add xarray-spatial in the conda section and remove pandas from the conda section (it installs an old version of xrspatial but the nb runs). I also edited the nb to use a smaller batch size and turned on gpu options in the pytorch lightning classes.
Does xarray-spatial in the pip section work better for you, like in this PR? I’m also interested in using xarray-spatial at runtime, while also keeping pandas around.
I haven’t tried xarray-spatial with pip because I didn’t want it to overwrite any libraries installed with conda when it installs pip dependencies. The above env file works for me. I think minimizing mixing pip with conda will lead to less issues down the road (like this one: BUG: can't import pandas · Issue #42506 · pandas-dev/pandas · GitHub), but if you need a new version of xarray-spatial pip might be the way to go.
@rbavery 'm not able to reproduce that error with the current environment file on Ubuntu 20.04; is there any more detail you can provide? You make a good point about conda and pip-specified dependencies. To some degree it’s unavoidable, since not all packages are in both sources, but I did clear up a few of the conda/pip conflicts in the most recent PR.
The xarray-spatial continues to be a bit of a struggle, but I think @stefan.istrate 's solution might be our best option. I’ll point out that in the benchmark xarray-spatial is only used for visualization, not for actual modeling, so there’s a possibility of just skipping it.
Right, I was able to use the runtime env as it is in the repo now. Importing pandas is even part of the build tests, so I’m stumped as to why it would be different in your case.
Yep it looks like the updates today fixed it. The pandas version changed in PR 14 (side note, why does this forum block links to github with a message "you can’t link to that host??)
the pandas version that the runtime .yml used before today was the source of my conda/pip issue. The environment file I posted above reflects the pandas environment used in today’s PR.