Hello,
I am trying to install a python package that requires HDF5 (h5py). I have installed HDF5 on Windows 10 using the installer. The installation seems to have been successful.
I still get the error: ’ Cannot open include file: ‘hdf5.h’: No such file or directory’ even though I can see the hdf5.h file in the Include directory.
Do you have any idea how I can resolve this issue and get the complier to find this file.
Many thanks.
Error:
[24/24] Cythonizing C:\Users\mjp321\AppData\Local\Temp\pip-install-p2d_lh9t\h5py_de07a0fdf0a04c709ef25b2c0e5226bd\h5py\utils.pyx
_ building ‘h5py.defs’ extension_
_ creating build\temp.win-amd64-cpython-311_
_ creating build\temp.win-amd64-cpython-311\Release_
_ creating build\temp.win-amd64-cpython-311\Release\Users_
_ creating build\temp.win-amd64-cpython-311\Release\Users\mjp321_
_ creating build\temp.win-amd64-cpython-311\Release\Users\mjp321\AppData_
_ creating build\temp.win-amd64-cpython-311\Release\Users\mjp321\AppData\Local_
_ creating build\temp.win-amd64-cpython-311\Release\Users\mjp321\AppData\Local\Temp_
_ creating build\temp.win-amd64-cpython-311\Release\Users\mjp321\AppData\Local\Temp\pip-install-p2d_lh9t_
_ creating build\temp.win-amd64-cpython-311\Release\Users\mjp321\AppData\Local\Temp\pip-install-p2d_lh9t\h5py_de07a0fdf0a04c709ef25b2c0e5226bd_
_ creating build\temp.win-amd64-cpython-311\Release\Users\mjp321\AppData\Local\Temp\pip-install-p2d_lh9t\h5py_de07a0fdf0a04c709ef25b2c0e5226bd\h5py_
_ “C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.34.31933\bin\HostX86\x64\cl.exe” /c /nologo /O2 /W3 /GL /DNDEBUG /MD -DH5_USE_18_API -DNPY_NO_DEPRECATED_API=0 -D_HDF5USEDLL_ -DH5_BUILT_AS_DYNAMIC_LIB -I.\h5py -IC:\Users\mjp321\AppData\Local\Temp\pip-install-p2d_lh9t\h5py_de07a0fdf0a04c709ef25b2c0e5226bd\lzf -IC:\Users\mjp321\AppData\Local\Temp\pip-install-p2d_lh9t\h5py_de07a0fdf0a04c709ef25b2c0e5226bd\lzf\lzf -IC:\Users\mjp321\AppData\Local\Temp\pip-install-p2d_lh9t\h5py_de07a0fdf0a04c709ef25b2c0e5226bd\windows -IC:\Users\mjp321\AppData\Local\Temp\pip-build-env-l9nbg_49\overlay\Lib\site-packages\numpy\core\include “-IC:\Users\mjp321\Documents\kd_package (1)\kd_package\kd_calculator\include” “-IC:\Program Files\Python311\include” “-IC:\Program Files\Python311\Include” “-IC:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.34.31933\include” “-IC:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Auxiliary\VS\include” “-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\ucrt” “-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\um” “-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\shared” “-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\winrt” “-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\cppwinrt” “-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\include\um” /TcC:\Users\mjp321\AppData\Local\Temp\pip-install-p2d_lh9t\h5py_de07a0fdf0a04c709ef25b2c0e5226bd\h5py\defs.c /Fobuild\temp.win-amd64-cpython-311\Release\Users\mjp321\AppData\Local\Temp\pip-install-p2d_lh9t\h5py_de07a0fdf0a04c709ef25b2c0e5226bd\h5py\defs.obj_
_ defs.c_
_ C:\Users\mjp321\AppData\Local\Temp\pip-install-p2d_lh9t\h5py_de07a0fdf0a04c709ef25b2c0e5226bd\h5py\api_compat.h(27): fatal error C1083: Cannot open include file: ‘hdf5.h’: No such file or directory_
_ error: command ‘C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.34.31933\bin\HostX86\x64\cl.exe’ failed with exit code 2_
_ [end of output]_
_ note: This error originates from a subprocess, and is likely not a problem with pip._
_ ERROR: Failed building wheel for h5py_
Failed to build h5py
ERROR: Could not build wheels for h5py, which is required to install pyproject.toml-based projects