0

I'm trying to import gradient_richardson_number from metpy.calc with the error:

Traceback (most recent call last): File "", line 1, in ImportError: cannot import name 'gradient_richardson_number'

I can import all other packages from metpy.calc. Any suggestions would be welcome.

MaartenDev
  • 5,631
  • 5
  • 21
  • 33
  • Can you include the full trace back for the error as well as the actual line of code that failed? (I know that seems silly in this case.) Also, what does `import metpy; print(metpy.__version__)` show? – DopplerShift Aug 18 '21 at 14:21
  • I'm using metpy 0.12.2 (and python 3.6.10)>>> import metpy.calc >>> from metpy.calc import gradient_richardson_number Traceback (most recent call last): File "", line 1, in ImportError: cannot import name 'gradient_richardson_number' – user16695803 Aug 18 '21 at 15:18

1 Answers1

0

gradient_richardson_number was added in MetPy 1.0. If you look at the docs for v0.12 you can see that it's not listed. To use gradient_richardson_number, you'll need to update to at least 1.0. If you installed using conda, then you would use:

conda install metpy=1.0

Otherwise you can update with pip using:

pip install metpy~=1.0

You should also be aware that MetPy 1.1 dropped support for Python < 3.7.

DopplerShift
  • 5,472
  • 1
  • 21
  • 20