HDF5 库版本错误 - HDF5 ver 1.10.4

HDF5 library version error - HDF5 ver 1.10.4

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

问题是我找不到HDF5版本1.10.5 另一方面,不明白我可以降级什么。

在此link: 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是version 1.10.4而warning中HDF5的version是1.10.5

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

pip uninstall h5py
pip install h5py

如果您使用 conda 安装 tensorflow,它会安装 1.10.5 版本的 h5py,并在顶部安装 hdf5 1.10.4。创建在 pip "juggling" 之后解决的冲突,因为 1.10.4 满足最新的 h5py.

我遇到了和你一样的问题。之所以会出现,是因为tensorflow是conda安装的。使用通道anaconda时错误消失。

conda install -c anaconda tensorflow

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

当我意识到(在 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,一切似乎都正常。

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

在 Windows 10 日,使用 anaconda 你可以这样做:

conda install -c conda-forge hdf5=1.10.5

我有简单的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 的 window 10 位用户。 我有类似的问题,我解决了以下问题: 错误: 用户警告:当 h5py 是针对 1.10.4 构建时,h5py 运行 针对 HDF5 1.10.5,这可能会导致问题

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

它使用了tensorflow.yml 与清洁环境列表:

https://github.com/jeffheaton/t81_558_deep_learning

在window提示下:

conda env create -v -f tensorflow

然后打开anaconda prompt

conda acticate tensorflow python sum.py or in jupyter notebook. run with OK.

我遇到了同样的问题。

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

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

conda 安装 tensorflow

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

conda 安装conda-forgetensorflow

然后,安装了1.10.6。 'conda-forge' 强烈建议安装 conda。

我通过

安装tensorflow时发生了这种情况

conda install -c conda-forge tensorflow

我是这样解决的:

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

pip uninstall h5py

conda uninstall h5py

conda uninstall tensorflow

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

conda install -c anaconda tensorflow

该死的,我在 anaconda 提示符中显示了同样的错误,相信我的原因真的很愚蠢。

我是 multi-tasking,我是 forgot to activate the environment,这导致了两个不同版本的 HDF5。

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