stlsoonerwx
stlsoonerwx

Reputation: 11

Unable to use netcdf4 in anaconda python

I am unable to use netCDF4 within anaconda python. When I do "import netCDF4", I get the following error: /home/myusrname/anaconda/lib/./libk5crypto.so.3: symbol k5_buf_free, version krb5support_0_MIT not defined in file libkrb5support.so.0 with link time reference .

The netCDF4 module had been working just fine for me until I installed pyart (weather radar visualization software) which, for some reason, wanted to re-install netCDF4. Another thread described this problem (https://stackoverflow.com/questions/32050441/unable-to-use-netcdf4-within-python-anaconda), though the solution was to wipe and re-install anaconda. Does anyone know of another workaround? Thanks!

Upvotes: 1

Views: 4129

Answers (1)

Luke Madaus
Luke Madaus

Reputation: 11

I had the same problem, and even completely uninstalling and reinstalling the Anaconda distribution didn't fix it. Looks like using "conda" to install netCDF4 now looks for the krb libraries in the wrong place.

I was able to get it to work following a recent update to the netCDF4 code to version 1.1.7. This is the update info from their site (https://github.com/Unidata/netcdf4-python):

3/19/2015: Version 1.1.7 released. Global Interpreter Lock (GIL) now released >when extension module calls C library for read operations. This speeds up >concurrent reads when using threads. Users who wish to use netcdf4-python >inside threads should read http://www.hdfgroup.org/hdf5-quest.html#gconc >regarding thread-safety in the HDF5 C library. Fixes to setup.py now ensure >that pip install netCDF4 with export USE_NCCONFIG=0 will use environment >variables to find paths to libraries and include files, instead of relying >exclusively on the nc-config utility.

Following that, I set the environment variable "USE_NCCONFIG=0" and then used "pip" to install netCDF4 instead of "conda". That finally got it to work. Hopefully that works for you too (or you already fixed it...).

Upvotes: 1

Related Questions