Downloading and installing PyNGL and/or PyNIO

The current version of PyNIO is 1.4.1 and of PyNGL is 1.4.0, both released on July 28, 2011. They are supported under Python 2.6 and 2.7, and NumPy 1.4, 1.5, and 1.6.

We have beta versions of PyNIO and PyNGL available that were released internally for a NCAR-based Python conference. We recommend trying these binaries instead of the older ones. We are working fervently to get official releases of PyNGL and PyNIO out under conda.

See the "What's new" section to learn more about this version. These two packages are available in source code or binary format.

The source code licenses for PyNIO and PyNGL are similar to the The University of Illinois/NCSA Open Source license.

The binary licenses for PyNIO and PyNGL are similar to the old binary license for the previous versions. A separate binary license is necessary because of the additional 3rd party software included.

To download and install PyNGL or PyNIO on your system, you need to:

Request an ESG account

If this is your first visit to the Earth System Grid, a short registration is required. To register, go to:

and look on the right side of the page under "Quick Links" for "Create Account".

Download the source code and/or appropriate PyNGL and/or PyNIO binaries for your system

You can browse the different versions of PyNIO and PyNGL by going to and clicking on:

"PyNGL: Python Interface to the NCL Graphics Libraries"
"PyNIO: Python Interface for Multi-format Geoscientific Data I/O"
in the bottom center of the page. You don't need to login to browse the website.

When you find the version you're interested in, clicking on "Download files for this collection" will prompt you for your ESG login and password. You will need to agree to a source code or binary license before you can download any files.

There are two ways to download a file:

  1. You can click on the filename in the left side of the table directly to download it to your current system.

  2. If you need to download a binary for a remote system, you can use "wget" to download one or more files. To use "wget", check one or more boxes to the left of the filename(s) you want to download. Click on "Download all selected files" and you will be given a chance to download a wget script for those files.

  • Depending on what you downloaded, read one or both of the following sections on installing binaries or building from source code.

    Remove old versions

    Since PyNGL and PyNIO used to be packaged together, it might be a good idea to remove any old combined versions before installing the individual PyNGL or PyNIO packages.

    You can do this by removing the "PyNGL" directory from the appropriate "site-packages" directory under your python distribution. This location may vary from system to system, but is generally found in $PYTHONPREFIX/lib/pythonx.y/site-packages, where x.y is the version of python, like 2.6 or 2.7.

    Install software

    Test software

    You can quickly test PyNIO and PyNGL by running python and importing their respective modules:

    import Nio
    import Ngl

    For more extensive PyNIO tests, see the test PyNIO section.

    For more extensive PyNGL tests, you can run any one of the examples in the gallery by typing:

       pynglex example_name
    For example:
       pynglex ngl01p
    Note that some of these examples depend on PyNIO, and will not run unless you install PyNIO, or use another package to read in the data files.

    For a list of all the examples, type:

       pynglex -l
    The default for most of these examples is to send the output to a PostScript file using the example name, with a ".ps" appended. To change the output to an X11 window, PDF, or PNG file, use the "-w" option:
       pynglex -w x11 hdf1
       pynglex -w pdf tickmark2
       pynglex -w png xy2

    Note that if the output file contains multiple frames and you are sending the output to an X11 window, you need to click on the window with your left mouse button to advance the next frame. Or, you can position your mouse over the window and hit <RETURN>.