Stream: jupyter

Topic: python dependencies on cheyenne


view this post on Zulip Charlie Koven (Apr 17 2020 at 20:35):

Hi All, Not sure if this is the right place to post this but I have a question. I'm trying to plot a thing, using xarray via jupyter on cheyenne, and am getting the following error:

ImportError: Plotting of arrays of cftime.datetime objects or arrays indexed by cftime.datetime objects requires the optional nc-time-axis (v1.2.0 or later) package.

which I see arises from here: https://github.com/pydata/xarray/blob/master/xarray/plot/utils.py#L570

my question is, does anyone know the easiest way to satisfy such a dependency on cheyenne? my current python environment is just the standard one that load via the ncar_pylib command, and I'm not very sophisticated in dealign with dependencies on that system; i.e. how do I install further things on top of that? thanks for any tips!

view this post on Zulip Deepak Cherian (Apr 17 2020 at 20:42):

I think you have two options.

Option 1 : Follow "Creating your own clone of the NCAR Package Library" and then pip install nc-time-axis

- https://www2.cisl.ucar.edu/resources/python-%E2%80%93-ncar-package-library

Option 2 : Follow https://github.com/NCAR/ncar-python-tutorial and then you're totally independent of whatever CISL chooses to provide on cheyenne.

view this post on Zulip Matt Long (Apr 17 2020 at 20:43):

@Charlie Koven, my recommendation is use conda to create your own environment.

The README here
https://github.com/NCAR/ncar-python-tutorial
bundles several steps together. Essentially these are

  1. Download and install miniconda
    You can get Miniconda here
    https://docs.conda.io/en/latest/miniconda.html
    (64-bit linux, Python 3)

  2. Create environment from a file
    Here's an example environment file
    https://github.com/marbl-ecosys/cesm2-marbl/blob/master/environment.yaml
    You can modify this to suit your purposes, then run

conda env create -f environment.yaml

view this post on Zulip Charlie Koven (Apr 17 2020 at 20:45):

ok, thanks both. i'll try those. i've managed to avoid having to make a conda install on cheyenne thusfar but i guess it may be necessary.

view this post on Zulip Charlie Koven (Apr 17 2020 at 20:53):

ok @Deepak Cherian your method worked. no conda install needed. cheers both!


Last updated: Jan 30 2022 at 12:01 UTC