[python #MVR-694466]: Cartopy (0.14.2) / MetPy (0.12.2) parse(cf) error when using Google Colab
- Subject: [python #MVR-694466]: Cartopy (0.14.2) / MetPy (0.12.2) parse(cf) error when using Google Colab
- Date: Mon, 23 Nov 2020 20:48:13 -0700
I went ahead and answered your Stack Overflow question here:
We can continue any needed discussion there.
> Hi All:
> I have a student facing a problem that is similar to what others are
> reporting when using older versions of MetPy and Cartopy.
> The issue is the parse_cf() command under metpy. And it's happening under
> Google Colaboratory, of which I have little experience. Things are working
> fine on other platforms (anaconda, miniconda, homebrew, etc)
> Previous feedback I've seen refers to rolling back the version of the cartopy
> library from 0.18.*. I have also followed previously posted guidance on
> Shapely, but we cannot seem to be able to change the versions of cartopy or
> metpy version in Google CoLab.
> The version information for the environment and python libraries, followed by
> the code and error is below.
> I'm at a loss here and have troubleshot it for my student about as far as I
> can go. Guidance would be appreciated by both of us.
> System and Package Information
> MetPy 0.12.2
> Cartopy 0.14.2
> 3.6.9 (default, Oct 8 2020, 12:12:24)
> [GCC 8.4.0]
> Linux d8a71c5140a6 4.19.112+ #1 SMP Thu Jul 23 08:00:38 PDT 2020 x86_64
> x86_64 x86_64 GNU/Linux
> python-cartopy/bionic,now 0.14.2+dfsg1-2build3 amd64 [installed]
> python3-cartopy/bionic,now 0.14.2+dfsg1-2build3 amd64 [installed]
> Code to Replicate
> import numpy as np
> import cartopy as c
> import metpy as metpy
> file_218 =
> ds218 = xr.open_dataset(file_218)
> ds218 = ds218.metpy.parse_cf()
> Error Message
> NameError Traceback (most recent call last)
> <ipython-input-9-4362f5b26659> in <module>()
> 9 file_218 =
> 10 ds218 = xr.open_dataset(file_218)
> ---> 11 ds218 = ds218.metpy.parse_cf()
> 1 frames
> /usr/local/lib/python3.6/dist-packages/metpy/xarray.py in parse_cf(self,
> varname, coordinates)
> 510 """
> 511 from .cbook import iterable
> --> 512 from .plots.mapping import CFProjection
> 514 if varname is None:
> /usr/local/lib/python3.6/dist-packages/metpy/plots/__init__.py in <module>()
> 17 logger = logging.getLogger(__name__)
> ---> 19 __all__ = ctables.__all__[:] # pylint: disable=undefined-variable
> 20 __all__.extend(declarative.__all__) # pylint: disable=undefined-variable
> 21 __all__.extend(skewt.__all__) # pylint: disable=undefined-variable
> NameError: name 'ctables' is not defined
> Any ideas would be appreciated, Iâm out of âem here.
Ticket ID: MVR-694466
Department: Support Python
NOTE: All email exchanges with Unidata User Support are recorded in the Unidata
inquiry tracking system and then made publicly available through the web. If
you do not want to have your interactions made available in this way, you must
let us know in each email you send to us.