警告! *** HDF5库版本不匹配错误*** python pandas windows

时间:2017-07-31 09:09:19

标签: python windows pandas hdf5

我使用pandas / python以HDFStore格式保存DataFrame。当我应用 my_data_frame.to_hdf(arguments ...)命令时,我收到一条错误消息:警告! *** HDF5库版本不匹配错误 ***并且我的程序已停止。

我正在使用Python 3.5.2 :: Anaconda 4.1.1(64位)在Windows 7(64位)上工作。

我一直在阅读有关此错误消息的内容,因为它说我的计算机上安装的HDF5版本与Anacondas使用的版本之间存在问题。根据{{​​3}}帖子,一个简单的 " conda install -c anaconda hdf5 = 1.8.18" 可以解决我的问题,但我可以解决这个问题。 m仍然有相同的消息错误。

感谢您的帮助。

这里我给出了错误的完整日志:


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

    General Information:
    -------------------
                       HDF5 Version: 1.8.18
                      Configured on: 2017-05-31
                      Configured by: NMake Makefiles
                     Configure mode: CMAKE 3.8.0
                        Host system: Windows-6.3.9600
                  Uname information: Windows
                           Byte sex: little-endian
                          Libraries:
                 Installation point: C:/bld/hdf5_1496269860661/_b_env/Library

    Compiling Options:
    ------------------
                   Compilation Mode: RELEASE
                         C Compiler: C:/Program Files (x86)/Microsoft Visual Studio
    14.0/VC/bin/amd64/cl.exe
                             CFLAGS: /DWIN32 /D_WINDOWS /W3
                          H5_CFLAGS:
                          AM_CFLAGS:
                           CPPFLAGS:
                        H5_CPPFLAGS:
                        AM_CPPFLAGS:
                   Shared C Library: YES
                   Static C Library: YES
      Statically Linked Executables: OFF
                            LDFLAGS: /machine:x64
                         AM_LDFLAGS:
                    Extra libraries: C:/bld/hdf5_1496269860661/_b_env/Library/lib/z.
    lib
                           Archiver:
                             Ranlib:
                  Debugged Packages:
                        API Tracing: OFF

    Languages:
    ----------
                            Fortran: OFF
                   Fortran Compiler:
              Fortran 2003 Compiler:
                      Fortran Flags:
                   H5 Fortran Flags:
                   AM Fortran Flags:
             Shared Fortran Library: YES
             Static Fortran Library: YES

                                C++: ON
                       C++ Compiler: C:/Program Files (x86)/Microsoft Visual Studio
    14.0/VC/bin/amd64/cl.exe
                          C++ Flags: /DWIN32 /D_WINDOWS /W3 /GR /EHsc
                       H5 C++ Flags:
                       AM C++ Flags:
                 Shared C++ Library: YES
                 Static C++ Library: YES

    Features:
    ---------
                      Parallel HDF5: OFF
                 High Level library: ON
                       Threadsafety: ON
                Default API Mapping: v18
     With Deprecated Public Symbols: ON
             I/O filters (external):  DEFLATE
                                MPE:
                         Direct VFD:
                            dmalloc:
    Clear file buffers before write: ON
               Using memory checker: OFF
             Function Stack Tracing: OFF
          Strict File Format Checks: OFF
       Optimization Instrumentation:

7 个答案:

答案 0 :(得分:11)

 Headers are 1.8.15, library is 1.8.18

您的错误信息显示在此,因此您需要安装1.8.15版本。

conda install -c anaconda hdf5=1.8.15

答案 1 :(得分:1)

在macOS上唯一适合我的过程是创建一个virtualenv:

virtualenv -p python3 myenv
. myenv/bin/activate
pip3 install h5py==1.10.4 # or whichever version you want

绝对没有其他作用!

您可能需要一个brew install hdf5

没有帮助的github问题:

https://github.com/h5py/h5py/issues/1068

答案 2 :(得分:1)

由于某种原因,使用conda卸载,然后再次使用conda安装hdf5无法正常工作。但是,如果使用pip卸载,然后使用conda安装hdf5,则可以正常工作。

所以尝试:

pip uninstall hdf5
conda install hdf5

答案 3 :(得分:0)

这为我修复了它,希望对您有所帮助。

第一步

pip uninstall h5py

第二步

pip install h5py

答案 4 :(得分:0)

您还可以强制安装自定义软件包版本:

conda install --force-reinstall anaconda hdf5==1.8.15

conda install -c conda-forge hdf5=1.8.15

答案 5 :(得分:0)

我在这里尝试了每种方法,但是其他方法也起作用。所以我想到了分享。

conda install -c conda-forge hdf5=1.10.5 #newer system's problem
conda install -c conda-forge hdf5=1.8.18 #for this particular problem

它将强制安装或升级您的hdf5。当您玩杂耍时,它会同时卸载keras,而当您安装keras时,它会升级hdf5。因此,伪造修改它以使其起作用。

答案 6 :(得分:0)

我的案例很简单,不需要任何安装:我已经使用spyderIPython环境中启动了conda和一个cmd控制台:

activate env
spyder

然后我使用hdf5升级了envcmd的{​​{1}}。但是,在同一conda控制台中运行代码后,我收到了类似的错误消息。只需重启IPython和相应的spyder控制台即可。我想这会一致地重新加载软件包。