[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[python #JYK-434092]: Error running radiosonde plotting script from tutorial



Greetings,

Apologies for the delayed response.

This error should be fixed with Cartopy >= 0.19, so make sure you're running 
the latest cartopy.

Cheers,

Ryan

> Hi,
> 
> I downloaded sample source code from the MetPy tutorial to learn how to make 
> a sounding plot.
> https://unidata.github.io/MetPy/latest/tutorials/upperair_soundings.html#sphx-glr-tutorials-upperair-soundings-py
> 
> My MetPy version is 1.6 and with miniconda/3.9.
> 
> Following  is the error message that has been returned.
> 
> [alim@rets15 post_processing]$ python test.py
> Traceback (most recent call last):
> File "/home/alim/post_processing/test.py", line 24, in <module>
> from metpy.plots import Hodograph, SkewT
> File "/home/alim/.local/lib/python3.9/site-packages/metpy/plots/__init__.py", 
> line 8, in <module>
> from . import cartopy_utils, plot_areas
> File 
> "/home/alim/.local/lib/python3.9/site-packages/metpy/plots/plot_areas.py", 
> line 15, in <module>
> ccrs.NorthPolarStereo(central_longitude=-100)),
> File "/opt/miniconda/4.12.0/lib/python3.9/site-packages/cartopy/crs.py", line 
> 1513, in __init__
> super(NorthPolarStereo, self).__init__(
> File "/opt/miniconda/4.12.0/lib/python3.9/site-packages/cartopy/crs.py", line 
> 1476, in __init__
> a = np.float(self.globe.semimajor_axis or WGS84_SEMIMAJOR_AXIS)
> File "/home/alim/.local/lib/python3.9/site-packages/numpy/__init__.py", line 
> 324, in __getattr__
> raise AttributeError(__former_attrs__[attr])
> AttributeError: module 'numpy' has no attribute 'float'.
> `np.float` was a deprecated alias for the builtin `float`. To avoid this 
> error in existing code, use `float` by itself. Doing this will not modify any 
> behavior and is safe. If you specifically wanted the numpy scalar type, use 
> `np.float64` here.
> The aliases was originally deprecated in NumPy 1.20; for more details and 
> guidance see the original release note at:
> https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations
> 
> Please advise.
> 
> Thanks
> Agnes
> 
> 
> 


Ticket Details
===================
Ticket ID: JYK-434092
Department: Support Python
Priority: Low
Status: Closed
===================
NOTE: All email exchanges with NSF 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.