[pyngl-talk] Importing PyNIO from a conda install

Ray Hawthorne frontogenesis at gmail.com
Wed Mar 16 15:51:32 MDT 2016


Hi Dave,

Yes, I downloaded from the ncar channel (version 1.4.3).

The library is very good overall and works on most grib2 files.  The only two model data files (that I’ve tried anyway) that do not play nicely are:
HREF (High Resolution Ensemble Forecast) - http://nomads.ncep.noaa.gov/pub/data/nccf/com/hiresw/prod/ <http://nomads.ncep.noaa.gov/pub/data/nccf/com/hiresw/prod/>
Wavewatch - http://nomads.ncep.noaa.gov/pub/data/nccf/com/wave/prod/ <http://nomads.ncep.noaa.gov/pub/data/nccf/com/wave/prod/>  (the multi_1 data, specifically)

Several others I’ve used (RAP, GFS, SREF) work great.  The Wavewatch model data can pulled in as netcdf through the opendap server, and I’m able to plot that through the netcdf4 library.  However, the HREF is only available via grib2, so I’m a little out of luck on that one.

Just thought I’d pass along.

Thanks again for the help and for this nice tool,

Ray


> On Mar 16, 2016, at 2:13 PM, David Brown <dbrown at ucar.edu> wrote:
> 
> Hi Ray,
> We were aware of the krb5 problem, but so far we have only updated the
> code to handle it for the beta version of PyNIO in the 'dbrown'
> channel. We will update the 'ncar' channel with the 1.4.3 version of
> PyNIO today. Is that the version that you installed?
> As for the GRIB2 file, PyNIO does support GRIB2 probability data in
> general, but apparently there is some feature of these particular
> files that it does not yet handle. We will investigate. Thanks for the
> report.
> -dave
> 
> 
> 
> On Tue, Mar 15, 2016 at 8:33 AM, Ray Hawthorne <frontogenesis at gmail.com> wrote:
>> Natalie’s suggestion appears to be the smoking gun.  I’m able to import Nio
>> now, and was able to open up a RAP GRIB2 file downloaded from NOMADS.
>> 
>> The original file I was attempting to open is throwing me an error and
>> aborting.  I’m not sure if pynio supports probability files, so I’ll take a
>> closer look at that portion of the pynio documentation later on.
>> 
>>>>> import Nio
>>>>> f = Nio.open_file("href.t06z.prob.f36.grib2")
>> Abort trap: 6
>> 
>> Thank you for the help,
>> 
>> Ray
>> 
>> 
>> 
>> 
>> On Mar 15, 2016, at 8:16 AM, Tourville,Natalie
>> <Natalie.Tourville at colostate.edu> wrote:
>> 
>> Hi Ray,
>> 
>> We recently ran into this error and installing krb5 fixed the issue.  It’s
>> looking for the libgssapi_krb5.2.2.dylib library (found in the krb5
>> package).
>> 
>> conda install krb5
>> 
>> And then reinstall PyNio.
>> 
>> Regards,
>> -Natalie Tourville
>> 
>> 
>> On Mar 15, 2016, at 6:49 AM, Kyle Griffin <ksgriffin2 at wisc.edu> wrote:
>> 
>> Ray,
>> 
>> If you import a module with a certain name, you must reference its functions
>> with that name as well. Since 'import Nio' is how the module was intended to
>> be imported, the instructions are to use that. Since you've imported PyNIO,
>> you would have to use 'PyNIO.open_file(....)' to use things from the PyNIO
>> module. Alternatively, you can do 'import PyNIO as Nio' to create an alias
>> with which you can refer to the module - this would allow your
>> 'Nio.open_file(...)' statements to work as you've written them.
>> 
>> 
>> Kyle
>> 
>> On Tue, Mar 15, 2016 at 7:06 AM Ray Hawthorne <frontogenesis at gmail.com>
>> wrote:
>> Good morning Dave,
>> 
>> Unfortunately, that does not work.
>> 
>> Here’s what I get back when importing Nio:
>> 
>> import Nio
>> 
>> Traceback (most recent call last):
>> File "<stdin>", line 1, in <module>
>> File
>> "/Users/frontogenesis/anaconda2/lib/python2.7/site-packages/PyNIO/Nio.py",
>> line 63, in <module>
>>   from nio import *
>> ImportError:
>> dlopen(/Users/frontogenesis/anaconda2/lib/python2.7/site-packages/PyNIO/nio.so,
>> 2): Library not loaded: @rpath/libgssapi_krb5.2.2.dylib
>> Referenced from:
>> /Users/frontogenesis/anaconda2/lib/python2.7/site-packages/PyNIO/nio.so
>> Reason: image not found
>> 
>> 
>> Here’s what I get when importing PyNIO (success), but try to open the file
>> (not successful):
>> 
>> import PyNIO
>> f = Nio.open_file("href.t06z.prob.f36.grib2")
>> 
>> Traceback (most recent call last):
>> File "<stdin>", line 1, in <module>
>> NameError: name 'Nio' is not defined
>> 
>> -Ray
>> 
>> On Mar 14, 2016, at 11:19 PM, David Brown <dbrown at ucar.edu> wrote:
>> 
>> The standard way to import PyNIO is simply:
>> 
>> import Nio
>> 
>> f = Nio.open_file(<filename>)
>> 
>> Let us know if that doesn't work.
>> -dave
>> 
>> 
>> 
>> 
>> 
>> On Mon, Mar 14, 2016 at 9:10 PM, Ray Hawthorne <frontogenesis at gmail.com>
>> wrote:
>> 
>> Greetings,
>> 
>> I just installed PyNIO from anaconda and I’m having some trouble reading in
>> a grib2 file.
>> 
>> Using the documentation, when I do an import into my Python script:
>> import Nio
>> 
>> The import fails to occur.
>> 
>> I dug around in the anaconda subdirectories and tried:
>> import PyNIO
>> And that import statement works just fine.
>> 
>> However, when I go to open a grib file:
>> f = Nio.open_file("href.t06z.prob.f36.grib2”)
>> I end up getting a traceback.
>> 
>> (Similar issue with importing PyNio.Nio as Nio)
>> 
>> I suspect there’s a discrepancy between the documentation and the build of
>> PyNIO from anaconda — but I’m somewhere in the advanced beginner stage when
>> it comes to Python in general, so I’m not sure how I might be able to fix
>> this so that I can open the grib file with pynio.  Would someone be able to
>> point me in the right direction?
>> 
>> Thanks,
>> 
>> Ray Hawthorne
>> _______________________________________________
>> pyngl-talk mailing list
>> List instructions, subscriber options, unsubscribe:
>> http://mailman.ucar.edu/mailman/listinfo/pyngl-talk
>> 
>> 
>> _______________________________________________
>> pyngl-talk mailing list
>> List instructions, subscriber options, unsubscribe:
>> http://mailman.ucar.edu/mailman/listinfo/pyngl-talk
>> _______________________________________________
>> pyngl-talk mailing list
>> List instructions, subscriber options, unsubscribe:
>> http://mailman.ucar.edu/mailman/listinfo/pyngl-talk
>> 
>> 
>> 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/pyngl-talk/attachments/20160316/f9badc73/attachment.html 


More information about the pyngl-talk mailing list