简体   繁体   English

h5py 安装错误失败,退出状态为 2

[英]h5py install error failed with exit status 2

I am using Windows 7 and Python 2.7.9.我使用的是 Windows 7 和 Python 2.7.9。 I tried to install h5py with pip, but have the following error:我尝试使用 pip 安装 h5py,但出现以下错误:

[c:\\users\\dell\\appdata\\local\\temp\\pip-build-j2msd9\\h5py\\h5py\\api_compat.h(27) : fatal error C1083: cannot open include file:“hdf5.h”: No such file or directory [c:\\users\\dell\\appdata\\local\\temp\\pip-build-j2msd9\\h5py\\h5py\\api_compat.h(27):致命错误 C1083:无法打开包含文件:“hdf5.h”:没有这样的文件或目录

error: command 'd:\\visual studio 2008\\VC\\BIN\\amd64\\cl.exe' failed with exit status 2错误:命令 'd:\\visual studio 2008\\VC\\BIN\\amd64\\cl.exe' 失败,退出状态为 2

http://i.stack.imgur.com/N3VO8.jpg


things I have tried:我尝试过的事情:

  1. Reinstall Visual Studio 2008 compiler重新安装 Visual Studio 2008 编译器
  2. installed some necessary modules such as modHDF5 and numpy安装了一些必要的模块,例如modHDF5numpy

The error you are getting is because you have not installed HDF5, or you have not specified the directory that HDF5 has been installed into.你得到的错误是因为你没有安装 HDF5,或者你没有指定 HDF5 安装到的目录。

The simplest thing to do, is to try to install h5py with a modern pip which supports wheels (eg run python.exe -m pip install -U pip , and then try reinstalling h5py).最简单的方法是尝试使用支持轮子的现代 pip 安装 h5py(例如运行python.exe -m pip install -U pip ,然后尝试重新安装 h5py)。

If you want to build from source on Windows, see http://docs.h5py.org/en/latest/build.html#source-installation-on-windows , but I strongly recommend using wheels on Windows (as the person who wrote said CI scripts).如果您想在 Windows 上从源代码构建,请参阅http://docs.h5py.org/en/latest/build.html#source-installation-on-windows ,但我强烈建议在 Windows 上使用轮子(作为写了说 CI 脚本)。

我将 h5py 的版本更改为 2.9.0 并且它的工作非常吸引人请检查与预构建包一起安装的版本。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM