mamba env create -f environment-gpu.yaml
it installs but then the blog post notebook doesn’t run and fails when importing pandas
ImportError: cannot import name 'DtypeArg' from 'pandas._typing' (/home/rave/miniconda3/envs/condaenv/lib/python3.9/site-packages/pandas/_typing.py)
this looks related to this issue
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 was able to reproduce the blog post nb with this env file
- conda-forge/label/broken # required imagecodecs is marked broken
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.
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
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.
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.
@rbgb This details the issue with the runtime env file: environment file installs but can't import pandas · Issue #11103 · conda/conda · GitHub The env file I posted above works because I edited it. Is that the env file that works for you or are you saying the runtime env file works for you and you are able to import pandas after it finishes installing?
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.
@rbavery There were some updates to the env today that touch on pandas, you might try again with the most recent version of the
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.