tensorflow环境搭建之h5py安装问题

h5py安装问题

import h5py时,发现了一个非常有意思的问题

ImportError                               Traceback (most recent call last)
<ipython-input-1-222c37a30cec> in <module>
      1 import numpy as np
----> 2 import h5py
      3 import matplotlib.pyplot as plt
      4 import tensorflow as tf
      5 from tensorflow.python.framework import ops

D:\Program\Anaconda3\envs\tensorflow\lib\site-packages\h5py\__init__.py in <module>
     32         raise
     33 
---> 34 from . import version
     35 
     36 if version.hdf5_version_tuple != version.hdf5_built_version_tuple:

D:\Program\Anaconda3\envs\tensorflow\lib\site-packages\h5py\version.py in <module>
     15 
     16 from collections import namedtuple
---> 17 from . import h5 as _h5
     18 import sys
     19 import numpy

h5py\h5.pyx in init h5py.h5()

ImportError: DLL load failed: 找不到指定的程序。

输入conda list,发现h5py版本为3.1.0

tensorflow环境搭建之h5py安装问题_第1张图片

通过文件目录D:\Program\Anaconda3\envs\tensorflow\Lib\site-packages查看,发现h5py版本为2.10.0

tensorflow环境搭建之h5py安装问题_第2张图片

原因:

pip和conda都安装了h5py,版本冲突

解决方法:

conda uninstall h5py
pip uninstall h5py
pip install h5py

你可能感兴趣的:(DeepLearning,tensorflow,深度学习,python)