Python 无法使用最新的HDF5打开matlab文件

Python 无法使用最新的HDF5打开matlab文件,python,matlab,hdf5,pytables,Python,Matlab,Hdf5,Pytables,我最近在python安装中升级了表,HDF5库中似乎发生了一些奇怪的事情 我有一堆数据最初保存为.mat文件,使用HDF5格式。我一直在使用pyTables将其读入python,到目前为止,它一直工作得很好 我将pyTables升级到3.0版,看起来这一定也升级了我的HDF5安装(或者类似的东西)。现在,每当我尝试将.mat文件读入内存时,都会出现以下错误: Warning! ***HDF5 library version mismatched error*** The HDF5 header

我最近在python安装中升级了表,HDF5库中似乎发生了一些奇怪的事情

我有一堆数据最初保存为.mat文件,使用HDF5格式。我一直在使用pyTables将其读入python,到目前为止,它一直工作得很好

我将pyTables升级到3.0版,看起来这一定也升级了我的HDF5安装(或者类似的东西)。现在,每当我尝试将.mat文件读入内存时,都会出现以下错误:

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.5, library is 1.8.9
        SUMMARY OF THE HDF5 CONFIGURATION
        =================================

General Information:
-------------------
           HDF5 Version: 1.8.9
          Configured on: Tue Sep 11 15:02:44 CDT 2012
          Configured by: ilan@centos5x86
         Configure mode: production
            Host system: x86_64-unknown-linux-gnu
          Uname information: Linux centos5x86 2.6.18-308.el5 #1 SMP Tue Feb 21 20:06:06 EST 2012 x86_64 x86_64 x86_64 GNU/Linux
               Byte sex: little-endian
              Libraries:
         Installation point: /opt/anaconda1anaconda2anaconda3

Compiling Options:
------------------
               Compilation Mode: production
                     C Compiler: /usr/bin/gcc ( gcc (GCC) 4.1.2 20080704 )
                         CFLAGS:
                      H5_CFLAGS: -std=c99 -pedantic -Wall -Wextra -Wundef -Wshadow -Wpointer-arith -Wbad-function-cast -Wcast-qual -Wcast-align -Wwrite-strings -Wconversion -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -Wnested-externs -Winline -Wno-long-long -Wfloat-equal -Wmissing-format-attribute -Wmissing-noreturn -Wpacked -Wdisabled-optimization -Wformat=2 -Wunreachable-code -Wendif-labels -Wdeclaration-after-statement -Wold-style-definition -Winvalid-pch -Wvariadic-macros -Wnonnull -Winit-self -Wmissing-include-dirs -Wswitch-default -Wswitch-enum -Wunused-macros -Wunsafe-loop-optimizations -Wc++-compat -Wvolatile-register-var -O3 -fomit-frame-pointer -finline-functions
                      AM_CFLAGS:
                       CPPFLAGS:
                    H5_CPPFLAGS: -D_POSIX_C_SOURCE=199506L   -DNDEBUG -UH5_DEBUG_API
                    AM_CPPFLAGS: -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_BSD_SOURCE
               Shared C Library: yes
               Static C Library: no
  Statically Linked Executables: no
                        LDFLAGS:
                     H5_LDFLAGS:
                     AM_LDFLAGS:
        Extra libraries:  -lz -lrt -lm
               Archiver: ar
             Ranlib: ranlib
          Debugged Packages:
            API Tracing: no

Languages:
----------
                        Fortran: no

                            C++: no

Features:
---------
                  Parallel HDF5: no
             High Level library: yes
                   Threadsafety: no
            Default API Mapping: v18
 With Deprecated Public Symbols: yes
         I/O filters (external): deflate(zlib)
         I/O filters (internal): shuffle,fletcher32,nbit,scaleoffset
                            MPE: no
                     Direct VFD: no
                        dmalloc: no
Clear file buffers before write: yes
           Using memory checker: no
         Function Stack Tracing: no
                           GPFS: no
      Strict File Format Checks: no
   Optimization Instrumentation: no
       Large File Support (LFS): yes
Bye...
Aborted
然后它打断python并将我扔回shell

我已经尝试将pyTables降级到3.0之前的版本,但这没有帮助。我还尝试在matlab中重新打开并再次保存,但仍然不起作用


你知道怎么回事吗?听起来Matlab保存到的HDF5版本与pyTables假设的版本不同。看起来我要么更新Matlab的HDF5库,要么降级python库,但我不知道该怎么做…

好的,我知道问题出在哪里了。基本上,这是一个版本冲突。(为什么总是版本冲突?)

显然,pip和anaconda对PyTables有两种不同的命名约定。皮普称之为“桌子”,而蟒蛇称之为“桌子”

因此,当我运行
conda install tables
时,anaconda查找了表,但没有找到,默认使用pip。然后Pip找到表并安装了它

问题是,anaconda发行版中已经安装了PyTables,只是它被称为“PyTables”

所以现在我在同一发行版上有两个不同版本的表,一个是通过pip安装的,另一个是通过anaconda安装的。这是在做各种不可靠的事情,并导致上述错误


因此,吸取的教训是:永远不要假设大型软件包存储库确保它们将事物称为同一事物P

感谢您解释您找到的解决方案-我今天遇到了同样的问题。因此,请注意我在阅读您精彩的解释后输入的明确行:
pip uninstall tables
conda install pytables