Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I want to run a Python script that uses the module netCDF4. Therefore I followed the instructions here: http://netcdf4-python.googlecode.com/svn/trunk/docs/netCDF4-module.html

For what reason ever, it doesn't work with the HDF5-Version I installed. I installed the latest version (1.8.10) in my home-directory. But Python comes with this error:

$ import netCDF4
ImportError                               Traceback (most recent call last)
/user/timo/<ipython-input-2-f731da2de255> in <module>()
----> 1 import netCDF4
/user/timo/netCDF4.pyx in init netCDF4 (netCDF4.c:46771)()
ImportError: netCDF4 module must be linked against HDF5 version 1.8.4-patch1 or higher, got 1.8.10

So I deleted the folders for the 1.8.10-Version (manually) from my home dir and installed the 1.8.4-patch1. (Maybe the '.10'-version is not compatible?)

But this doesn't solve the problem. The error when I run the Python script is still the same. That's why I thought there must be somewhere anything of the '.10'-version I did not delete, so I searched for 'hdf5':

4> sudo find / -name 'hdf5'

(in '/user/timo/hdf5' is the installed '1.8.4-patch1'-version)

I guess my Python script will run, after I have deleted the '1.8.10'-version completely. Can anyone help me out?

(I'm using 'Ubuntu 12.04.1 LTS' and 'Python2.7')

share|improve this question

1 Answer 1

I am definitely also not an expert but looking at the netCDF4 page you have linked, you'll probably have to rebuild it after installing the older HDF5 version.

However I am wondering if you build netCDF4 with the flags that are listed under "Required", why the newest version should not work.

What does export say? Are your HDF5 variables set correct?

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.