[SciPy-user] Help with Scientific's NetCDF[SEC=UNCLASSIFIED]

Robert Kern robert.kern at gmail.com
Wed Apr 23 19:52:07 EDT 2008


On Wed, Apr 23, 2008 at 6:43 PM, Scott Collis <s.collis at bom.gov.au> wrote:
> Ok, I know this is not strictly SciPy, being from the Scientific
>  Branch... But I was hoping some one might know...
>
>  I have been able to get the Scientific.IO.NetCDF library working on
>  other machines but trying to install it, as a user (no root access...)
>  on a cluster machine here I get the following error:
>  >>> import Scientific.IO.NetCDF
>  Traceback (most recent call last):
>   File "<stdin>", line 1, in ?
>   File
>  "/flurry/home/scollis/pylibs/lib64/python2.4/site-packages/Scientific/IO/NetCDF.py", line 165, in ?
>     from Scientific_netcdf import *
>  ImportError: libnetcdf.so.4: cannot open shared object file: No such
>  file or directory
>
>  now I have found where libnetcdf.so.4 is located and I have added that
>  to sys.path {sys.path.append("/usr/local/netcdf-3.6.2a/lib/")} I have
>  tried assing said directory to PYTHONPATH (export
>  PYTHONPATH="/usr/local/netcdf-3.6.2a/lib/")

Both of those are for loading Python modules, not linking non-python
shared libraries. Instead, you need to set the environment variable
LD_LIBRARY_PATH. Note that you must set this variable before the
python executable even starts; you cannot add it inside your code with
os.putenv().

-- 
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless
enigma that is made terrible by our own mad attempt to interpret it as
though it had an underlying truth."
 -- Umberto Eco



More information about the SciPy-User mailing list