警告!***HDF 5库版本不匹配错误***python panda windows

yzckvree  于 2022-12-30  发布在  Windows
关注(0)|答案(9)|浏览(351)

我正在使用panda/python将DataFrame保存为HDFStore格式。当我应用 my_data_frame.to_hdf(arguments...) 命令时,我收到一条错误消息:警告!*HDF 5库版本不匹配错误并且我的程序停止。
我在Windows 7(64位)上工作,使用Python 3.5.2:Anaconda 4.1.1(64位)。
我一直在阅读这个错误信息,正如它所说,这是一个问题之间的HDF 5版本安装在我的电脑和一个使用的Anaconda.根据this后,一个简单的***“conda install -c anaconda hdf 5 =1.8.18”***可以解决我的问题,但我仍然有相同的消息错误.
谢谢你们的帮助。
这里我把错误的完整日志:

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:
sy5wg1nm

sy5wg1nm1#

尝试卸载h5py模块并重新安装。这为我修复了它
1.第一个月

  1. pip install h5py
1qczuiv0

1qczuiv02#

Headers are 1.8.15, library is 1.8.18

然后,您的错误信息显示您需要安装1.8.15版本。

conda install -c anaconda hdf5=1.8.15
c2e8gylq

c2e8gylq3#

由于某种原因,用conda卸载然后用conda重新安装hdf5是不起作用的,但是如果你用pip卸载然后用conda安装hdf5,它是起作用的。
所以试试看:

pip uninstall hdf5
conda install hdf5
quhf5bfb

quhf5bfb4#

我在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

yhived7q

yhived7q5#

如果有人遇到这个问题,并且使用pipconda或任何东西卸载都不起作用:我检查了每个/lib路径,手动删除了libhdf5*文件,然后用macports安装了hdf5

xxls0lw8

xxls0lw86#

我的情况是微不足道的,不需要任何安装:我使用cmdconda环境启动了spyderIPython控制台:

activate env
spyder

然后我用conda升级了cmd中的env。然而,在同一个IPython控制台中运行我的代码后,我得到了一个类似的错误消息。所需要的只是重新启动spyder和相应的IPython控制台。我想这会一致地重新加载包。

k2fxgqgv

k2fxgqgv7#

我尝试了所有的方法,但只有一种完全有效-

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

这将强制安装-通过升级或降级-你的hdf 5。这反过来将卸载它的keras,当你重新安装keras升级hdf 5。

eni9jsuy

eni9jsuy8#

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

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

conda install -c conda-forge hdf5=1.8.15
sc4hvdpw

sc4hvdpw9#

因为我在Debian上的hdf 5库并不像pip 3想象的那么新,它帮助我使用apt作为根目录安装python3-h5 py包,而不是通过pip 3在本地安装。

相关问题