Re: ncarg problem when attempting to import Nio

From: David Brown <dbrown_at_nyahnyahspammersnyahnyah>
Date: Tue Dec 14 2010 - 17:33:20 MST

Hi,

Rather than specifying the directories for PyNGL and PyNIO directly, it looks as if you need to specify the path for the site-packages directory. Try:

sys.path.append('/usr/lib/python2.6/site-packages')

Normally I would expect that this would be part of sys.path by default, but apparently not in your case. Anyway PyNIO is looking for a subdirectory of one the sys.path elements named PyNIO/ncarg. Hope this helps.
 -dave

On Dec 14, 2010, at 4:54 PM, Jshgwave wrote:

>
> We installed the binaries for PyNGL and PyNIO on a 64-bit Debian Linux system.
>
> Whenever I try to import Nio by following the example on the page
> http://www.pyngl.ucar.edu/Nio.shtml,
> the importing fails because ncarg is not found.
>
> ncarg is not found even when sys.path.append is used to point to folders that contain ncarg,
> as is illustrated by the following session:
>
> midat:/home/hornstein> python2.6
> Python 2.6.6 (r266:84292, Nov 28 2010, 18:42:58)
> [GCC 4.4.5] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
> >>> import sys
> >>> import numpy as np
> >>> sys.path.append('/usr/lib/python2.6/site-packages/PyNGL')
> >>> sys.path.append('/usr/lib/python2.6/site-packages/PyNIO')
> >>> sys.path
>
> ['', '/usr/lib/python2.6', '/usr/lib/python2.6/plat-linux2', '/usr/lib/python2.6/lib-tk', '/usr/lib/python2.6/lib-old', '/usr/lib/python2.6/lib-dynload', '/usr/local/lib/python2.6/dist-packages', '/usr/lib/python2.6/dist-packages', '/usr/lib/pymodules/python2.6', '/usr/lib/python2.6/site-packages/PyNGL', '/usr/lib/python2.6/site-packages/PyNIO']
>
> >>> # The last-named folder includes the files Nio.py and Nio.pyc.
> ... import Nio
>
> No path found to PyNIO/ncarg data directory and no usable NCARG installation found
> midat:/home/hornstein>
>
> As the last line shows, the failure to find ncarg always catapults me out of Python.
>
>
> The following shows the two locations that contain folders named "ncarg":
>
> midat:/home/hornstein> ls /usr/lib/python2.6/site-packages/PyNIO
> alt-setup.py coordsel.pyc ncarg nio.so _xarray.py
> alt-setup.pyc __init__.py Nio.py pynio_version.py _xarray.pyc
> coordsel.py __init__.pyc Nio.pyc pynio_version.pyc
>
> midat:/home/hornstein> ls /usr/lib/python2.6/site-packages/PyNGL
> fplib.so hlu.pyc __init__.py ncarg Ngl.pyc pyngl_version.pyc
> hlu.py _hlu.so __init__.pyc Ngl.py pyngl_version.py
>
>
>
> The ncarg subfolders in the PyNIO and PyNGL folders contain completely different sub-subfolders:
>
> midat:/home/hornstein> ls /usr/lib/python2.6/site-packages/PyNIO/ncarg
> grib2_codetables
>
> midat:/home/hornstein> ls /usr/lib/python2.6/site-packages/PyNGL/ncarg
> colormaps data database fontcaps graphcaps pynglex sysresfile
>
>
> By repeating the python session without any of the lines that pertain to PyNGL, I have verified that the difference between these two versions of the ncarg folder is not the problem.
>
> Thanks for your help.
>
>
> _______________________________________________
> 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
Received on Tue Dec 14 17:33:26 2010

This archive was generated by hypermail 2.1.8 : Wed Jan 05 2011 - 09:09:56 MST