【问题标题】:HDF5 library version error - HDF5 ver 1.10.4HDF5 库版本错误 - HDF5 ver 1.10.4
【发布时间】:2020-01-10 13:04:49
【问题描述】:

我正在尝试使用 spyder (OS x64)、Anaconda 和 pyton 3.x 导入一些包 该错误在互联网上非常有名。建议的解决方案是将库1.10.5的版本与HDF5匹配(我的是1.10.4)

问题是我找不到 HDF5 版本 1.10.5 另一方面,无法理解我可以降级的内容。

在此链接:https://anaconda.org/conda-forge/hdf5 似乎存在版本 1.10.5 但是当我输入 anaconda conda install -c conda-forge hdf5 的提示时 版本仍然是 1.10.4。

这里是警告:

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

General Information:
‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑
HDF5 Version: 1.10.5
Configured on: 2019????????
Configured by: Visual Studio 15 2017 Win64
Host system: Windows????.0.17763
Uname information: Windows
Byte sex: little‑endian
Installation point: C:/Program Files/HDF5

Compiling Options:
‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑
Build Mode: 
Debugging Symbols: 
Asserts: 
Profiling: 
Optimization Level: 

Linking Options:
‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑
Libraries: 
Statically Linked Executables: OFF
LDFLAGS: /machine:x64
H5_LDFLAGS: 
AM_LDFLAGS: 
Extra libraries: 
Archiver: 
Ranlib: 

Languages:
‑‑‑‑‑‑‑‑‑‑
C: yes
C Compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.16.27023/bin/Hostx86/x64/cl.exe 19.16.27027.1
CPPFLAGS: 
H5_CPPFLAGS: 
AM_CPPFLAGS: 
CFLAGS: /DWIN32 /D_WINDOWS /W3
H5_CFLAGS: 
AM_CFLAGS: 
Shared C Library: YES
Static C Library: YES

Fortran: OFF
Fortran 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/2017/Community/VC/Tools/MSVC/14.16.27023/bin/Hostx86/x64/cl.exe 19.16.27027.1
C++ Flags: /DWIN32 /D_WINDOWS /W3 /GR /EHsc
H5 C++ Flags: 
AM C++ Flags: 
Shared C++ Library: YES
Static C++ Library: YES

JAVA: OFF
JAVA Compiler: 

Features:
‑‑‑‑‑‑‑‑‑
Parallel HDF5: OFF
Parallel Filtered Dataset Writes: 
Large Parallel I/O: 
High‑level library: ON
Threadsafety: OFF
Default API mapping: v110
With deprecated public symbols: ON
I/O filters (external): DEFLATE DECODE ENCODE
MPE: 
Direct VFD: 
dmalloc: 
Packages w/ extra debug output: 
API Tracing: OFF
Using memory checker: OFF
Memory allocation sanity checks: OFF
Function Stack Tracing: OFF
Strict File Format Checks: OFF
Optimization Instrumentation: 
Bye...

这里安装了所有的包:

# packages in environment at C:\Users\Megaport\Anaconda3\envs\venv:
#
# Name                    Version                   Build  Channel
_py-xgboost-mutex         2.0                       cpu_0
_tflow_select             2.3.0                       mkl
absl-py                   0.8.0                    pypi_0    pypi
alabaster                 0.7.12                   py37_0
asn1crypto                0.24.0                   py37_0
astor                     0.8.0                    pypi_0    pypi
astroid                   2.2.5                    py37_0
atomicwrites              1.3.0                    py37_1
attrs                     19.1.0                   py37_1
babel                     2.7.0                      py_0
backcall                  0.1.0                    py37_0
blas                      1.0                         mkl
bleach                    3.1.0                    py37_0
ca-certificates           2019.5.15                     1
certifi                   2019.6.16                py37_1
cffi                      1.12.3           py37h7a1dbc1_0
chardet                   3.0.4                 py37_1003
cloudpickle               1.2.1                      py_0
colorama                  0.4.1                    py37_0
cryptography              2.7              py37h7a1dbc1_0
cycler                    0.10.0                   py37_0
decorator                 4.4.0                    py37_1
defusedxml                0.6.0                      py_0
docutils                  0.15.2                   py37_0
entrypoints               0.3                      py37_0
fastcache                 1.1.0            py37he774522_0
freetype                  2.9.1                ha9979f8_1
gast                      0.2.2                    pypi_0    pypi
google-pasta              0.1.7                    pypi_0    pypi
grpcio                    1.23.0                   pypi_0    pypi
h5py                      2.10.0                   pypi_0    pypi
hdf5                      1.10.4               h7ebc959_0
icc_rt                    2019.0.0             h0cc432a_1
icu                       58.2                 ha66f8fd_1
idna                      2.8                      py37_0
imagesize                 1.1.0                    py37_0
importlib_metadata        0.19                     py37_0
intel-openmp              2019.4                      245
ipykernel                 5.1.2            py37h39e3cac_0
ipython                   7.8.0            py37h39e3cac_0
ipython_genutils          0.2.0                    py37_0
isort                     4.3.21                   py37_0
jedi                      0.15.1                   py37_0
jinja2                    2.10.1                   py37_0
joblib                    0.13.2                   py37_0
jpeg                      9b                   hb83a4c4_2
jsonschema                3.0.2                    py37_0
jupyter_client            5.3.1                      py_0
jupyter_core              4.5.0                      py_0
keras                     2.2.4                         0
keras-applications        1.0.8                      py_0
keras-base                2.2.4                    py37_0
keras-preprocessing       1.1.0                      py_1
keyring                   18.0.0                   py37_0
kiwisolver                1.1.0            py37ha925a31_0
lazy-object-proxy         1.4.2            py37he774522_0
libmklml                  2019.0.5                      0
libpng                    1.6.37               h2a8f88b_0
libprotobuf               3.8.0                h7bd577a_0
libsodium                 1.0.16               h9d3ae62_0
libxgboost                0.90                          0
m2w64-gcc-libgfortran     5.3.0                         6
m2w64-gcc-libs            5.3.0                         7
m2w64-gcc-libs-core       5.3.0                         7
m2w64-gmp                 6.1.0                         2
m2w64-libwinpthread-git   5.0.0.4634.697f757               2
markdown                  3.1.1                    py37_0
markupsafe                1.1.1            py37he774522_0
matplotlib                3.1.1            py37hc8f65d3_0
mccabe                    0.6.1                    py37_1
mistune                   0.8.4            py37he774522_0
mkl                       2019.4                      245
mkl-service               2.0.2            py37he774522_0
mkl_fft                   1.0.14           py37h14836fe_0
mkl_random                1.0.2            py37h343c172_0
more-itertools            7.2.0                    py37_0
mpmath                    1.1.0                    py37_0
msys2-conda-epoch         20160418                      1
nbconvert                 5.5.0                      py_0
nbformat                  4.4.0                    py37_0
numpy                     1.17.2                   pypi_0    pypi
numpy-base                1.16.4           py37hc3f5095_0
numpydoc                  0.9.1                      py_0
openssl                   1.1.1c               he774522_1
opt-einsum                3.0.1                    pypi_0    pypi
packaging                 19.1                     py37_0
pandas                    0.25.1           py37ha925a31_0
pandoc                    2.2.3.2                       0
pandocfilters             1.4.2                    py37_1
parso                     0.5.1                      py_0
pickleshare               0.7.5                    py37_0
pip                       19.2.2                   py37_0
pluggy                    0.12.0                     py_0
prompt_toolkit            2.0.9                    py37_0
protobuf                  3.9.1                    pypi_0    pypi
psutil                    5.6.3            py37he774522_0
py                        1.8.0                    py37_0
py-xgboost                0.90                     py37_0
py-xgboost-cpu            0.90                     py37_0
pycodestyle               2.5.0                    py37_0
pycparser                 2.19                     py37_0
pyflakes                  2.1.1                    py37_0
pygments                  2.4.2                      py_0
pylint                    2.3.1                    py37_0
pyopenssl                 19.0.0                   py37_0
pyparsing                 2.4.2                      py_0
pyqt                      5.9.2            py37h6538335_2
pyreadline                2.1                      py37_1
pyrsistent                0.14.11          py37he774522_0
pysocks                   1.7.0                    py37_0
pytest                    5.0.1                    py37_0
python                    3.7.4                h5263a28_0
python-dateutil           2.8.0                    py37_0
pytz                      2019.2                     py_0
pywin32                   223              py37hfa6e2cd_1
pyyaml                    5.1.2            py37he774522_0
pyzmq                     18.1.0           py37ha925a31_0
qt                        5.9.7            vc14h73c81de_0
qtawesome                 0.5.7                    py37_1
qtconsole                 4.5.4                      py_0
qtpy                      1.9.0                      py_0
requests                  2.22.0                   py37_0
rope                      0.14.0                     py_0
scikit-learn              0.21.2           py37h6288b17_0
scipy                     1.3.1            py37h29ff71c_0
setuptools                41.2.0                   pypi_0    pypi
sip                       4.19.8           py37h6538335_0
six                       1.12.0                   pypi_0    pypi
snowballstemmer           1.9.0                      py_0
sphinx                    2.1.2                      py_0
sphinxcontrib-applehelp   1.0.1                      py_0
sphinxcontrib-devhelp     1.0.1                      py_0
sphinxcontrib-htmlhelp    1.0.2                      py_0
sphinxcontrib-jsmath      1.0.1                      py_0
sphinxcontrib-qthelp      1.0.2                      py_0
sphinxcontrib-serializinghtml 1.1.3                      py_0
spyder                    3.3.6                    py37_0
spyder-kernels            0.5.1                    py37_0
sqlite                    3.29.0               he774522_0
sympy                     1.4                      py37_0
tb-nightly                1.15.0a20190806          pypi_0    pypi
tensorboard               1.14.0           py37he3c9ec2_0
tensorflow                1.14.0          mkl_py37h7908ca0_0
tensorflow-base           1.14.0          mkl_py37ha978198_0
tensorflow-estimator      1.14.0                     py_0
termcolor                 1.1.0                    pypi_0    pypi
testpath                  0.4.2                    py37_0
tornado                   6.0.3            py37he774522_0
traitlets                 4.3.2                    py37_0
urllib3                   1.24.2                   py37_0
vc                        14.1                 h0510ff6_4
vs2015_runtime            14.16.27012          hf0eaf9b_0
wcwidth                   0.1.7                    py37_0
webencodings              0.5.1                    py37_1
werkzeug                  0.15.6                   pypi_0    pypi
wheel                     0.33.6                   pypi_0    pypi
win_inet_pton             1.1.0                    py37_0
wincertstore              0.2                      py37_0
wrapt                     1.11.2           py37he774522_0
yaml                      0.1.7                hc54c509_2
zeromq                    4.3.1                h33f27b4_3
zipp                      0.5.2                      py_0
zlib                      1.2.11               h62dcd97_3

无论如何,我不明白为什么提示 HDF5 是 1.10.4 版本,而在警告中,HDF5 版本是 1.10.5

【问题讨论】:

  • 注意消息说 Headers1.10.4library1.10.5。我管理 conda 环境中的所有内容,并且没有遇到这个问题(我使用 spyder)。我有 hdf5 版本 1.10.4 / build h7ebc959_0。您是否对所有 Python 包使用 conda 包管理器?错误消息看起来像 Visual Studio 编译器。你是如何安装 HDF5 库的?您是否有可能拥有来自不同来源(用于 Python 和 C)的 HDF5 库版本?
  • 首先感谢您的帮助。 1)相同的版本和构建。 2)我正在使用 Anaconda Navigator,有时会提示 anaconda 3)我已经通过“conda install hdf5”的提示安装了 HDF5 4)我只使用 R 和 Spyder。正如你所说,我正在尝试检查 Visual Studio 编译器
  • 仔细阅读后,我有点困惑。运行conda install -c conda-forge hdf5 时是否收到第一条错误消息?如果是这样,为什么需要安装另一个版本的 HDF5 包?您已经在 conda 环境中拥有它(如第二个输出所示)。
  • 同时我尝试过:删除了环境。创造了一个新的。安装了所有软件包,然后在 env 中安装了 spyder。现在可以了,真的不知道发生了什么。感谢您的帮助
  • 我怀疑您在 2 个地方安装了 HDF5 库,并且 conda 环境“混乱”。康达有 1.10.4。您必须从 HDF5 组(默认安装到 C:/Program Files/HDF5)中获取 1.10.5。这与第一条错误消息一致。使用 conda 删除和重新安装是要走的路。有一个关于同一主题的 github 帖子:(github.com/h5py/h5py/issues/853)

标签: python anaconda spyder hdf5


【解决方案1】:

我将把它留在这里,因为它对我来说是一个顶部堆栈线程,没有明确的答案。

pip uninstall h5py
pip install h5py

如果您使用 conda 安装 tensorflow,它会安装 1.10.5 版本的 h5py,然后安装 hdf5 1.10.4。从 1.10.4 开始创建在 pip "juggling" 后解决的冲突满足最新的 h5py。

【讨论】:

    【解决方案2】:

    我和你有同样的问题。它的出现是因为 tensorflow 是由 conda 安装的。使用通道anaconda时错误消失。

    conda install -c anaconda tensorflow
    

    【讨论】:

      【解决方案3】:

      我在使用 Windows 10 时遇到了同样的问题。这就是我所做的

      1. 为 TensorFlow > 2.0 安装一些要求 https://www.tensorflow.org/install/pip?lang

      2. 创建 conda 虚拟环境:

      conda create -n ai python==3.7.6
      conda activate ai
      conda install pandas matplotlib scikit-learn scrapy seaborn
      conda install -c anaconda tensorflow
      

      【讨论】:

        【解决方案4】:

        当我意识到(在 Mac OSX Mojave 上)我使用 Homebrew 安装 Octave 时,我实际上解决了这个问题,它是为与 HDF5 1.10.5 一起工作而构建的。我第一次遇到这个问题是试图从 iPython 安装和运行 TensorFlow。我没有积极使用 Octave,所以我卸载了 Octave 以及 HDF5

        brew uninstall --force octave
        brew uninstall hdf5
        

        然后在重新运行时

        conda install h5py
        

        然后从 iPython 导入 TensorFlow,一切似乎都正常。

        【讨论】:

          【解决方案5】:

          也许我迟到了,但我通过将 hdf5 升级到 1.10.5 解决了这个问题。

          在 Windows 10 上,您可以使用 anaconda 执行此操作:

          conda install -c conda-forge hdf5=1.10.5
          

          【讨论】:

          • 朋友,我整天都在努力解决它。几乎尝试了所有方法,然后我找到了您的答案并决定试一试。当它奏效时,你无法想象我的解脱。谢谢
          【解决方案6】:

          我有简单的tensorflow代码sum.py:

          import tensorflow as tf
          
          a = tf.Variable(1, name="a")
          b = tf.Variable(2, name="b")
          f = a + b
          
          tf.print("The sum of a and b is", f)
          

          === 我是使用 Anaconda 3、tensorflow 2.0、jupyter 和 pyhton 3 的 windows 10 用户。 我有类似的问题,我解决了以下问题: 错误: 用户警告:h5py 在针对 1.10.4 构建时针对 HDF5 1.10.5 运行,这可能会导致问题

          我的环境被大量 pip 安装弄得一团糟。 以下视频解决了我的问题。 https://www.youtube.com/watch?v=RgO8BBNGB8w&t=376s

          它使用带有清洁环境列表的 tensorflow.yml:

          https://github.com/jeffheaton/t81_558_deep_learning

          窗口提示下:

          conda env create -v -f tensorflow

          然后打开anaconda提示

          conda 执行张量流 蟒蛇总和.py 或在 jupyter 笔记本中。 OK 运行。

          【讨论】:

            【解决方案7】:

            我遇到了同样的问题。

            警告! HDF5 库版本不匹配错误 标头是 1.10.4,库是 1.10.6

            我的解决方案是制作另一个 conda 环境,并使用“conda-forge”执行每个 conda。 由于 hdf5 1.10.4 在我的没有 GPU 的 win10 PC 上安装了以下命令。 Python 是 3.7.10。

            conda 安装张量流

            通过上面的命令,1.10.4 自带了。 所以,我应该做的。

            conda 安装 conda-forge tensorflow

            然后,安装了 1.10.6。 强烈推荐使用 conda 安装的“conda-forge”。

            【讨论】:

              【解决方案8】:

              当我通过安装 tensorflow 时发生这种情况

              conda install -c conda-forge tensorflow

              我是这样解决的:

              我通过以下方式卸载了 h5py 和 tensorflow:

              pip 卸载 h5py

              conda 卸载 h5py

              conda 卸载张量流

              并通过以下方式重新安装 tensorflow:

              conda install -c anaconda tensorflow

              【讨论】:

                【解决方案9】:

                该死的,我在 anaconda 提示中显示了同样的错误,并且相信我的理由真的很愚蠢。

                我同时处理多项任务,我 forgot to activate the environment 导致了两个不同版本的 HDF5。

                请确保在启动 jupyter notebook 之前conda activate environment_name

                【讨论】:

                  猜你喜欢
                  • 2020-07-11
                  • 2014-03-11
                  • 2018-01-06
                  • 1970-01-01
                  • 1970-01-01
                  • 2015-03-17
                  • 2012-08-22
                  • 2018-03-23
                  • 2018-10-07
                  相关资源
                  最近更新 更多