Installing PyNGL/PyNIO under Cygwin/X

If you want to run PyNGL and/or PyNIO (from here on referred to as just "PyNGL") under Windows, you must first download and install Cygwin/X. Cygwin/X provides you with a UNIX shell and an X server from which you can then run PyNGL.

Here are some step-by-step instructions for getting PyNGL to run under Cygwin/X. Please read these instructions all the way through before starting the installation.

  1. Install Cygwin/X
  2. Run Cygwin/X
  3. Download PyNGL
  4. Install and test PyNGL
  5. Set up DISPLAY environment variable
  6. Trouble shooting problems

  1. Install Cygwin/X

    To download and install Cygwin/X, go to the URL:

    http://x.cygwin.com/
    Read the "Downloading and installing" paragraph, which tells you which installation file you need to download (setup.exe), and what to do with it. It is recommended that you look through the "Installing Cygwin/X" in the Cygwin/X User's Guide, as it has some nice diagrams showing you each step of the installation process.

    When you start the installation process (by downloading "setup.exe" and double-clicking on the file wherever you downloaded it), you will be asked where to install Cygwin. I highly recommend that you select the default options, unless you know what you are doing.

    You wil eventually be asked to select a mirror site from which to download the software. I have found that some mirrors work better than others, and you may have to try several before you get a successful installation. I recommend starting with a mirror that is close to your geographic location, so the download is hopefully quicker.

    Once you select a mirror site, you will be prompted for which packages to install. The packages have categories like "Shells", "Devel", "Graphics", etc. Clicking on the plus (+) sign next to each category name will expand or close the list of packages associated with that category. Some categories and their related packages that you should install as a minimum include:

    • Category "Devel": install "gcc", "gdb", and "make".

    • Category "Editors": [optional] some popular editors that you might want for editing your files include "emacs" and "vim".

    • Category "Graphics": [optional] install "ghostscript" for viewing PostScript files.

    • Category "Shells": at a minimum, install "bash", "sh-utils", and "tcsh".

    • Category "X11": install all of the required packages that the "Installing Cygwin/X" section mentions (see #15 where it lists all the "xorg-x11" packages and whether they are required or optional). In addition to the required packages, be sure to also install "xorg-x11-devel". As of November 28, 2005, the list of packages that we recommend are:

      • xorg-x11-base
      • xorg-x11-bin
      • xorg-x11-bin-dlls
      • xorg-x11-bin-lndir
      • xorg-x11-devel
      • xorg-x11-etc
      • xorg-x11-fenc
      • xorg-x11-fnts
      • xorg-x11-libs-data
      • X-start-menu-icons
      • X-startup-scripts
      • xorg-x11-xwin

    To select any of these packages for installation, just click on the little circular icon next to it until you get a version number. Make sure you select the latest version number, if there are multiple ones. Some of the other options will be things like "skip", "uninstall", and "keep", which you don't want to use the first time through.)

    If the installation is successful, then the last item may be a window asking if you want to create some icon shortcuts for your desktop. Answer "yes" to this question as it will provide you with a little "startxwin" icon under Windows that you can double-click to start up Cygwin/X.

    If the installation fails or hangs while trying to install the software, then reboot if necessary, and rerun the setup.exe file as you did before, only this time choose a different mirror site.

  2. Run Cygwin/X

    Once the installation of Cygwin/X is complete, you need to start Cygwin/X, which will provide a terminal window for you to type commands in. If you have have a "startxwin" icon on your desktop, then you can start Cygwin/X by double-clicking on this icon. Otherwise, read the section "Using Cygwin/X" on how to start it. If you are successful, a window will pop up which you will then use for most of the instructions that follow. Newer versions of Cygwin/X will show a little "X" icon on your task bar if the X server was started successfully.

    You must start X/Cygwin before proceeding to the next section.

    Tip: if you installed Cygwin/X to the suggested location, then the Cygwin/X files will be installed under various directories under "c:\cygwin", and a home directory will be created for you under a path like "c:\cygwin\home\".

  3. Download PyNGL

    Now you are ready to download and install PyNGL. If you haven't already, go to the Earth System Grid web site and download the PyNGL binary that has the word "CYGWIN" in the name of the file.

    A good place to save this file is in the location "c:\cygwin\home\xxx", where xxx is the home directory the Cygwin/X installation set up for you.

  4. Install and test PyNGL

    Once you have the *.tar.gz file, follow the instructions at:

    http://www.pyngl.ucar.edu/download.shtml
    for information on installing and testing PyNGL and PyNIO on your system.

  5. Set up DISPLAY environment variable

    In order to run any X applications, including running PyNGL to display graphics to your screen, you may need to set up your environment by opening "c:\cygwin\home\xxx\.bashrc" in your favorite editor, and adding the following lines at the bottom:

        export DISPLAY=:0.0
    
    If you are using C-shell, then edit "c:\cygwin\home\xxx\.cshrc" and add the following line:
        setenv DISPLAY :0.0
    
  6. Trouble shooting problems

    If you are having problems running PyNGL, then here are some trouble shooting tips:

    • If you get the error:
       warning:GKS:GOPWK: --X driver error: error opening display
      
      then this probably means that your DISPLAY environment variable is not set, or it is set incorrectly. Please type:
      printenv DISPLAY
      
      and make sure that it is set to what is discussed in the "Set up DISPLAY environment variable" section above.

    • If it appears your DISPLAY is set correctly, and yet PyNGL still doesn't work, then you might be running the commands from a Cygwin window, and not a Cygwin/X window. The distinction is important, and you need to be running PyNGL from a Cygwin/X Window. Please read the section "Run Cygwin/X" and make sure you follow these instructions.

      You can tell if your Cygwin window is really a Cygwin/X window by the "X" icon that should appear in the upper left corner of the window.

    If you still have problems, then send email to pyngl-talk@ucar.edu. You need to be a member in order to post.