coolcoolad / pythonxy

Automatically exported from code.google.com/p/pythonxy
0 stars 0 forks source link

HDF Library Header mismatches #346

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
If relevant, please answer to the following questions:
1. What version of Python(x,y) have you installed?
2.6.6.1
2. Which components have you installed (Python(x,y) installer: component
page):
    I have selected the "Full" component selection?

3. Have you selected the option "Customize installation directories"?
b. No

5. Where did you install Python(x,y) itself?
a. default path

6. Have you installed Python(x,y):

    b. For "All users"
7. What is your operating system?
    Windows 7
8. When you installed Python(x,y), were you logged in as :

b. an administrator of the machine
9. If you are using Windows Vista, have you installed Python(x,y):

    b. by right-clicking on the installer and selecting "Run as an
administrator"
10. Regarding installed softwares on your machine, how did you clean your
machine before installing Python(x,y) (multiple answers are possible):

b. you uninstalled any previous Python distribution (including the
official .msi)

What steps will reproduce the problem?
1. import netCDF4
2. try to create a Dataset

What is the expected output? What do you see instead?
I try the following two lines:
>>> from netCDF4 import Dataset
>>> rootgrp = Dataset('test.nc', 'w', format='NETCDF4')

And this is what I get:
Warning! ***HDF5 library version mismatched error***
The HDF5 header files used to compile this application do not match
the version used by the HDF5 library to which this application is linked.
Data corruption or segmentation faults may occur if the application continues.
This can happen when an application was compiled by one version of HDF5 but
linked with a different version of static or shared HDF5 library.
You should recompile the application or check your shared library related
settings such as 'LD_LIBRARY_PATH'.
You can, at your own risk, disable this warning by setting the environment
variable 'HDF5_DISABLE_VERSION_CHECK' to a value of '1'.
Setting it to 2 or higher will suppress the warning messages totally.
Headers are 1.8.6, library is 1.8.5
Bye...

This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.

python then crashes.

I had this problem in an earlier version of pythonxy when trying to use 
PyTables and h5py within the same script.
Maybe you fixed this in the current version, but you might want to make sure 
that all modules using the HDF5 library are using the same library version and 
are compiled with the matching headers when building new versions of pythonxy.

Original issue reported on code.google.com by toromtom...@gmail.com on 13 Dec 2011 at 10:04

GoogleCodeExporter commented 9 years ago
Chances are there are version 1.8.5 HDF5*.DLL files somewhere in your Windows 
DLL search path. Or another imported package (e.g. H5py, PyTables) already 
loaded conflicting HDF5 DLLs into the process. 

Try something like this before importing netCDF4:

    import os
    from distutils.sysconfig import get_python_lib
    os.environ['PATH']=get_python_lib()+';'+os.environ['PATH']

Original comment by cjgoh...@gmail.com on 13 Dec 2011 at 5:07

GoogleCodeExporter commented 9 years ago
You are right.
Appartenly some module I had imported earlier also had imported PyTables.
So right now the story goes like this:
- if I import PyTables before netCDF4 everything goes boom as described.
- if I import netCDF4 first, I can afterwards import PyTables. This does not 
complain although I don't know whether it might break something later.
- I can also import h5py without any problems

Your fix doesn't work however, once PyTables was imported. 

What I also learned:
- PyTables loads its HDF5 DLL (hdf5dll.dll) from inside its own site-packages 
folder
- NetCDF4 loads its HDF5 DLL (hdf5dll.dll) directly from site-packages. This is 
the reason why those dlls clash
- h5py loads its DLL also from inside its own site-packages folder but uses a 
slightly different name (hdf5dll18.dll), so that it can coexist with the other 
two packages.

Therefore, might it be an idea to ask the package maintainers of NetCDF4, 
PyTables, h5py etc. to name their dlls with full version appended (like 
hdf5dll185.dll)? 

Original comment by toromtom...@gmail.com on 14 Dec 2011 at 6:02

GoogleCodeExporter commented 9 years ago
EPD has the same problem btw.

NetCDF4, PyTables, and h5py from http://www.lfd.uci.edu/~gohlke/pythonlibs/ are 
all compiled against the same version of HDF. 

The proposed fix was meant for situations where conflicting HDF5 dlls exist in 
the Windows search path, which is a common problem.

Original comment by cjgoh...@gmail.com on 14 Dec 2011 at 10:45

GoogleCodeExporter commented 9 years ago
Please test using PyTable 2.3.1 and NetCDF4 0.9.8

Original comment by grizzly.nyo on 19 Dec 2011 at 8:11

GoogleCodeExporter commented 9 years ago

Original comment by grizzly.nyo on 24 Dec 2011 at 6:19

GoogleCodeExporter commented 9 years ago

Original comment by grizzly.nyo on 24 Jan 2012 at 9:24