This archive contains answers to questions sent to Unidata support through mid-2025. Note that the archive is no longer being updated. We provide the archive for reference; many of the answers presented here remain technically correct, even if somewhat outdated. For the most up-to-date information on the use of NSF Unidata software and data services, please consult the Software Documentation first.
Hi, So a couple things: 1. On the box where you were able to download eccodes from Anaconda and install manually...could you try doing that with pygrib as well and avoid building? 2. As far as building pygrib, I don't think you actually need to do any building/linking against png/jasper/openjpeg for the interface where all you're doing is: import pygrib For that interface, based on my testing, all you need is to have eccodes compiled/linked against openjpeg/jasper and/or png (and even those are only to support GRIB using special compression methods). I actually have an open issue on pygrib about this (well, compiling again openjpeg): https://github.com/jswhit/pygrib/issues/123 As far as I can tell, pygrib is only building itself against jasper, etc. to use g2clib, which is only needed for `ncepgrib2`, which I'm not sure you need? My advice would be to build pygrib itself only against your copy of eccodes (skipping jpeg and png). If it builds, I'd see if it complains when you try to open your GRIB files. Ryan > Ok, so I was able to make some progress. Looks like there's some difficulties > on my end with the latest version of Conda installing packages from the web. > But, if I download and then install eccodes from a local file, I'm able to > get that far. I followed the instructions for editing setup.cfg in pygrib and > I'm getting errors on running setup.py. It appears that it's an issue with > the jasper library, as it's having issues with linking enc_jpeg2000.lib and > dec_jpeg2000.lib on the build/install process. > > > > I’m running windows 7 for this project. I’m concurrently attempting to > install eccodes and pygrib on my new windows 10 box as well; I was able to > successfully compile eccodes from the conda-forge source using Cygwin > yesterday. I have not yet attempted to install pygrib on the windows 10 box. > > > > Below is the tail end of my command prompt from running pygrib’s setup.py: > > > > [cid:image001.png@01D5A105.D4AFB110] > > > > This project is one of my very first forays into reading c code, so I don’t > have a firm grasp on what I’m doing here. I was able to find the > enc_jpeg2000.c and dec_jpeg2000.c files in the pygrib g2clib_src folder, but > I have no idea how to resolve the error. What I currently understand from the > error I’m getting and looking at those 2 .c files is that there are declared > functions for jpc_encode and jpc_decode, but I can’t seem to find the > definitions in any header/.h files. > > > > Taking a closer look, it seems as though whatever version of Jasper I > installed (pretty sure it’s from conda-forge) doesn’t have the jpc_encode and > jpc_decode functions defined. What versions of the image libraries are you > currently using? Ticket Details =================== Ticket ID: NMB-445318 Department: Support Python Priority: Low Status: Closed =================== NOTE: All email exchanges with 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.