0

I'm trying to open a grib2 file using pygrib but the error shows like this. Any help would be appreciated as I'm a new Python user

In [2]: debugfile('E:/NASA2/untitled0.py', wdir='E:/NASA2') File "e:\nasa2\untitled0.py", line 12 grbs = pygrib.open(2011.grb2) ^ SyntaxError: invalid syntax

  • should be `grbs = pygrib.open('2011.grb2')` but this shouldn't throw a syntax error. could you post your code? – diggusbickus Nov 02 '21 at 16:06
  • 1
    `2011.grb2`, without quote marks around it, is absolutely a syntax error. – jasonharper Nov 02 '21 at 16:15
  • 1
    It can't be a NameError, because it isn't a valid name - it's a floating-point literal followed by a name, with no operation in between. Just type `2011.grb2` into a Python interpreter and you will get a SyntaxError. – jasonharper Nov 02 '21 at 16:19
  • Actually I didn't have gpygrib module installed but in conda it is showing Packagesnotfound error when I try to install pygrib – Weathercoding Nov 02 '21 at 17:04

0 Answers0