pygrib
pygrib copied to clipboard
'unknown' data name when installing pygrib with pip
I faced the following issue while using pygrib 2.1.4 installed using pip.
File "src/pygrib/_pygrib.pyx", line 538, in pygrib._pygrib.open.select
ValueError: no matches found
The grib file i used is from ECMWF and contain '2m Temperature' and 'Total precipitation' data.
Ubuntu 22.04.2 LTS, Python==3.8.13 in a conda environement.
Using pip
pip install pygrib
Test case :
import pygrib
grb = pygrib.open('resources/forecast.grib')
for entry in grb.read(10):
print(entry.name)
Output :
unknown
2 metre temperature
unknown
2 metre temperature
unknown
2 metre temperature
unknown
2 metre temperature
unknown
2 metre temperature
Using conda
conda install pygrib -c conda-forge
Test case :
import pygrib
grb = pygrib.open('resources/forecast.grib')
for entry in grb.read(10):
print(entry.name)
Output :
Total precipitation
2 metre temperature
Total precipitation
2 metre temperature
Total precipitation
2 metre temperature
Total precipitation
2 metre temperature
Total precipitation
2 metre temperature
Same issue in #125 and #182 ?
Some grib records don't have a name attribute, apparently. This is not the fault of pygrib.
This issue is related to a different behavior of pygrib when installed using pip or conda. I used the same grib file for my tests and the grib records attribute name are returned correctly when pygrib is installed with conda and returned as unknown when pygrib is installed with pip.
probably conda is using a newer version of eccodes