0

I'm trying to get pygrib to work in Python 3.5. I have imported it in my program, I have assigned the grib file to a variable (grib).

But when I try to run the command:

grbs=pygrib.open(grib)

I get the following error:

File "", line 1, in print(sys.getdefault_encoding())

AttributeError: module 'sys' has no attribute 'getdefault_encoding'

No google search led me to any understanding of the problem.

What does this error actually mean?

Bijoy
  • 1,131
  • 1
  • 12
  • 23
Stephane
  • 31
  • 7
  • I don't think the under-scroll should be there. See the [doc](https://docs.python.org/3/library/sys.html#sys.getdefaultencoding) – Timothy Brown Jan 12 '18 at 19:28
  • Thanks Tim, You mean there would be an error in their program? If this is the case, where do I access the program to remove the extra underscore? – Stephane Jan 12 '18 at 19:40
  • Error seems to be in: File "pygrib.pyx", line 391, in pygrib.open.__cinit__ (pygrib.c:2902) File "pygrib.pyx", line 2070, in pygrib._strencode (pygrib.c:32191) NameError: name 'default_encoding' is not defined But where are these files? – Stephane Jan 12 '18 at 19:48
  • Can you show us the actual program? I just installed & used it without issues. – Timothy Brown Jan 12 '18 at 20:50
  • Thanks Tim, that's ointeresting. Yes I'll post it in the morning. May be versions or dependencies... – Stephane Jan 12 '18 at 22:44
  • I'm curious about how you managed to install it so quickly though. I've been on it for days trying to figure it out... – Stephane Jan 13 '18 at 09:20
  • See code linked. That's the best way I found: https://imgur.com/a/2F2OW – Stephane Jan 13 '18 at 09:30
  • I normally don't use [conda/miniconda](https://conda.io/miniconda.html) however it is easy to get something up and running quickly: `conda create --channel conda-forge --name test pygrib`. Glad it's working for you now. – Timothy Brown Jan 16 '18 at 15:20
  • Oh I didn't know that, thanks – Stephane Jan 17 '18 at 16:01

0 Answers0