I am trying to install Keras library using pip in windows 10. I have all the requirements installed, python>=3.8, pip>=20.0.0, NumPy, pandas, matplotlib, virtualenv. But I’m getting the following error.
JavaScript
x
95
95
1
(keras) C:Usersnamba>pip install keras
2
Collecting keras
3
Using cached Keras-2.4.3-py2.py3-none-any.whl (36 kB)
4
Collecting h5py
5
Using cached h5py-3.1.0.tar.gz (371 kB)
6
Installing build dependencies done
7
Getting requirements to build wheel done
8
Installing backend dependencies done
9
Preparing wheel metadata done
10
Requirement already satisfied: numpy>=1.9.1 in c:usersnambakeraslibsite-packages (from keras) (1.19.4)
11
Collecting pyyaml
12
Using cached PyYAML-5.3.1-cp38-cp38-win32.whl (199 kB)
13
Requirement already satisfied: scipy>=0.14 in c:usersnambakeraslibsite-packages (from keras) (1.5.4)
14
Building wheels for collected packages: h5py
15
Building wheel for h5py (PEP 517) error
16
ERROR: Command errored out with exit status 1:
17
command: 'c:usersnambakerasscriptspython.exe' 'c:usersnambakeraslibsite-packagespip_vendorpep517_in_process.py' build_wheel 'C:UsersnambaAppDataLocalTemptmp0_p1fdyc'
18
cwd: C:UsersnambaAppDataLocalTemppip-install-k9e6wdb4h5py
19
Complete output (70 lines):
20
running bdist_wheel
21
running build
22
running build_py
23
creating build
24
creating buildlib.win32-3.8
25
creating buildlib.win32-3.8h5py
26
copying h5pyh5py_warnings.py -> buildlib.win32-3.8h5py
27
copying h5pyipy_completer.py -> buildlib.win32-3.8h5py
28
copying h5pyversion.py -> buildlib.win32-3.8h5py
29
copying h5py__init__.py -> buildlib.win32-3.8h5py
30
creating buildlib.win32-3.8h5py_hl
31
copying h5py_hlattrs.py -> buildlib.win32-3.8h5py_hl
32
copying h5py_hlbase.py -> buildlib.win32-3.8h5py_hl
33
copying h5py_hlcompat.py -> buildlib.win32-3.8h5py_hl
34
copying h5py_hldataset.py -> buildlib.win32-3.8h5py_hl
35
copying h5py_hldatatype.py -> buildlib.win32-3.8h5py_hl
36
copying h5py_hldims.py -> buildlib.win32-3.8h5py_hl
37
copying h5py_hlfiles.py -> buildlib.win32-3.8h5py_hl
38
copying h5py_hlfilters.py -> buildlib.win32-3.8h5py_hl
39
copying h5py_hlgroup.py -> buildlib.win32-3.8h5py_hl
40
copying h5py_hlselections.py -> buildlib.win32-3.8h5py_hl
41
copying h5py_hlselections2.py -> buildlib.win32-3.8h5py_hl
42
copying h5py_hlvds.py -> buildlib.win32-3.8h5py_hl
43
copying h5py_hl__init__.py -> buildlib.win32-3.8h5py_hl
44
creating buildlib.win32-3.8h5pytests
45
copying h5pytestscommon.py -> buildlib.win32-3.8h5pytests
46
copying h5pytestsconftest.py -> buildlib.win32-3.8h5pytests
47
copying h5pyteststest_attribute_create.py -> buildlib.win32-3.8h5pytests
48
copying h5pyteststest_attrs.py -> buildlib.win32-3.8h5pytests
49
copying h5pyteststest_attrs_data.py -> buildlib.win32-3.8h5pytests
50
copying h5pyteststest_base.py -> buildlib.win32-3.8h5pytests
51
copying h5pyteststest_big_endian_file.py -> buildlib.win32-3.8h5pytests
52
copying h5pyteststest_completions.py -> buildlib.win32-3.8h5pytests
53
copying h5pyteststest_dataset.py -> buildlib.win32-3.8h5pytests
54
copying h5pyteststest_dataset_getitem.py -> buildlib.win32-3.8h5pytests
55
copying h5pyteststest_dataset_swmr.py -> buildlib.win32-3.8h5pytests
56
copying h5pyteststest_datatype.py -> buildlib.win32-3.8h5pytests
57
copying h5pyteststest_dimension_scales.py -> buildlib.win32-3.8h5pytests
58
copying h5pyteststest_dims_dimensionproxy.py -> buildlib.win32-3.8h5pytests
59
copying h5pyteststest_dtype.py -> buildlib.win32-3.8h5pytests
60
copying h5pyteststest_errors.py -> buildlib.win32-3.8h5pytests
61
copying h5pyteststest_file.py -> buildlib.win32-3.8h5pytests
62
copying h5pyteststest_file2.py -> buildlib.win32-3.8h5pytests
63
copying h5pyteststest_file_image.py -> buildlib.win32-3.8h5pytests
64
copying h5pyteststest_filters.py -> buildlib.win32-3.8h5pytests
65
copying h5pyteststest_group.py -> buildlib.win32-3.8h5pytests
66
copying h5pyteststest_h5.py -> buildlib.win32-3.8h5pytests
67
copying h5pyteststest_h5d_direct_chunk.py -> buildlib.win32-3.8h5pytests
68
copying h5pyteststest_h5f.py -> buildlib.win32-3.8h5pytests
69
copying h5pyteststest_h5p.py -> buildlib.win32-3.8h5pytests
70
copying h5pyteststest_h5pl.py -> buildlib.win32-3.8h5pytests
71
copying h5pyteststest_h5t.py -> buildlib.win32-3.8h5pytests
72
copying h5pyteststest_objects.py -> buildlib.win32-3.8h5pytests
73
copying h5pyteststest_selections.py -> buildlib.win32-3.8h5pytests
74
copying h5pyteststest_slicing.py -> buildlib.win32-3.8h5pytests
75
copying h5pytests__init__.py -> buildlib.win32-3.8h5pytests
76
creating buildlib.win32-3.8h5pytestsdata_files
77
copying h5pytestsdata_files__init__.py -> buildlib.win32-3.8h5pytestsdata_files
78
creating buildlib.win32-3.8h5pyteststest_vds
79
copying h5pyteststest_vdstest_highlevel_vds.py -> buildlib.win32-3.8h5pyteststest_vds
80
copying h5pyteststest_vdstest_lowlevel_vds.py -> buildlib.win32-3.8h5pyteststest_vds
81
copying h5pyteststest_vdstest_virtual_source.py -> buildlib.win32-3.8h5pyteststest_vds
82
copying h5pyteststest_vds__init__.py -> buildlib.win32-3.8h5pyteststest_vds
83
copying h5pytestsdata_filesvlen_string_dset.h5 -> buildlib.win32-3.8h5pytestsdata_files
84
copying h5pytestsdata_filesvlen_string_dset_utc.h5 -> buildlib.win32-3.8h5pytestsdata_files
85
copying h5pytestsdata_filesvlen_string_s390x.h5 -> buildlib.win32-3.8h5pytestsdata_files
86
running build_ext
87
Loading library to get version: hdf5.dll
88
error: Unable to load dependency HDF5, make sure HDF5 is installed properly
89
error: Could not find module 'hdf5.dll' (or one of its dependencies). Try using the full path with constructor syntax.
90
----------------------------------------
91
ERROR: Failed building wheel for h5py
92
Failed to build h5py
93
ERROR: Could not build wheels for h5py which use PEP 517 and cannot be installed directly
94
95
I thought this error was caused due to improper installation of h5py & hdf5. I tried installing them using pip install h5py
but then I encountered the following error:
JavaScript
1
89
89
1
(keras) C:Usersnamba>pip install h5py
2
Collecting h5py
3
Using cached h5py-3.1.0.tar.gz (371 kB)
4
Installing build dependencies done
5
Getting requirements to build wheel done
6
Installing backend dependencies done
7
Preparing wheel metadata done
8
Requirement already satisfied: numpy>=1.17.5; python_version == "3.8" in c:usersnambakeraslibsite-packages (from h5py) (1.19.4)
9
Building wheels for collected packages: h5py
10
Building wheel for h5py (PEP 517) error
11
ERROR: Command errored out with exit status 1:
12
command: 'c:usersnambakerasscriptspython.exe' 'c:usersnambakeraslibsite-packagespip_vendorpep517_in_process.py' build_wheel 'C:UsersnambaAppDataLocalTemptmpid2mdza_'
13
cwd: C:UsersnambaAppDataLocalTemppip-install-yppxk_bmh5py
14
Complete output (70 lines):
15
running bdist_wheel
16
running build
17
running build_py
18
creating build
19
creating buildlib.win32-3.8
20
creating buildlib.win32-3.8h5py
21
copying h5pyh5py_warnings.py -> buildlib.win32-3.8h5py
22
copying h5pyipy_completer.py -> buildlib.win32-3.8h5py
23
copying h5pyversion.py -> buildlib.win32-3.8h5py
24
copying h5py__init__.py -> buildlib.win32-3.8h5py
25
creating buildlib.win32-3.8h5py_hl
26
copying h5py_hlattrs.py -> buildlib.win32-3.8h5py_hl
27
copying h5py_hlbase.py -> buildlib.win32-3.8h5py_hl
28
copying h5py_hlcompat.py -> buildlib.win32-3.8h5py_hl
29
copying h5py_hldataset.py -> buildlib.win32-3.8h5py_hl
30
copying h5py_hldatatype.py -> buildlib.win32-3.8h5py_hl
31
copying h5py_hldims.py -> buildlib.win32-3.8h5py_hl
32
copying h5py_hlfiles.py -> buildlib.win32-3.8h5py_hl
33
copying h5py_hlfilters.py -> buildlib.win32-3.8h5py_hl
34
copying h5py_hlgroup.py -> buildlib.win32-3.8h5py_hl
35
copying h5py_hlselections.py -> buildlib.win32-3.8h5py_hl
36
copying h5py_hlselections2.py -> buildlib.win32-3.8h5py_hl
37
copying h5py_hlvds.py -> buildlib.win32-3.8h5py_hl
38
copying h5py_hl__init__.py -> buildlib.win32-3.8h5py_hl
39
creating buildlib.win32-3.8h5pytests
40
copying h5pytestscommon.py -> buildlib.win32-3.8h5pytests
41
copying h5pytestsconftest.py -> buildlib.win32-3.8h5pytests
42
copying h5pyteststest_attribute_create.py -> buildlib.win32-3.8h5pytests
43
copying h5pyteststest_attrs.py -> buildlib.win32-3.8h5pytests
44
copying h5pyteststest_attrs_data.py -> buildlib.win32-3.8h5pytests
45
copying h5pyteststest_base.py -> buildlib.win32-3.8h5pytests
46
copying h5pyteststest_big_endian_file.py -> buildlib.win32-3.8h5pytests
47
copying h5pyteststest_completions.py -> buildlib.win32-3.8h5pytests
48
copying h5pyteststest_dataset.py -> buildlib.win32-3.8h5pytests
49
copying h5pyteststest_dataset_getitem.py -> buildlib.win32-3.8h5pytests
50
copying h5pyteststest_dataset_swmr.py -> buildlib.win32-3.8h5pytests
51
copying h5pyteststest_datatype.py -> buildlib.win32-3.8h5pytests
52
copying h5pyteststest_dimension_scales.py -> buildlib.win32-3.8h5pytests
53
copying h5pyteststest_dims_dimensionproxy.py -> buildlib.win32-3.8h5pytests
54
copying h5pyteststest_dtype.py -> buildlib.win32-3.8h5pytests
55
copying h5pyteststest_errors.py -> buildlib.win32-3.8h5pytests
56
copying h5pyteststest_file.py -> buildlib.win32-3.8h5pytests
57
copying h5pyteststest_file2.py -> buildlib.win32-3.8h5pytests
58
copying h5pyteststest_file_image.py -> buildlib.win32-3.8h5pytests
59
copying h5pyteststest_filters.py -> buildlib.win32-3.8h5pytests
60
copying h5pyteststest_group.py -> buildlib.win32-3.8h5pytests
61
copying h5pyteststest_h5.py -> buildlib.win32-3.8h5pytests
62
copying h5pyteststest_h5d_direct_chunk.py -> buildlib.win32-3.8h5pytests
63
copying h5pyteststest_h5f.py -> buildlib.win32-3.8h5pytests
64
copying h5pyteststest_h5p.py -> buildlib.win32-3.8h5pytests
65
copying h5pyteststest_h5pl.py -> buildlib.win32-3.8h5pytests
66
copying h5pyteststest_h5t.py -> buildlib.win32-3.8h5pytests
67
copying h5pyteststest_objects.py -> buildlib.win32-3.8h5pytests
68
copying h5pyteststest_selections.py -> buildlib.win32-3.8h5pytests
69
copying h5pyteststest_slicing.py -> buildlib.win32-3.8h5pytests
70
copying h5pytests__init__.py -> buildlib.win32-3.8h5pytests
71
creating buildlib.win32-3.8h5pytestsdata_files
72
copying h5pytestsdata_files__init__.py -> buildlib.win32-3.8h5pytestsdata_files
73
creating buildlib.win32-3.8h5pyteststest_vds
74
copying h5pyteststest_vdstest_highlevel_vds.py -> buildlib.win32-3.8h5pyteststest_vds
75
copying h5pyteststest_vdstest_lowlevel_vds.py -> buildlib.win32-3.8h5pyteststest_vds
76
copying h5pyteststest_vdstest_virtual_source.py -> buildlib.win32-3.8h5pyteststest_vds
77
copying h5pyteststest_vds__init__.py -> buildlib.win32-3.8h5pyteststest_vds
78
copying h5pytestsdata_filesvlen_string_dset.h5 -> buildlib.win32-3.8h5pytestsdata_files
79
copying h5pytestsdata_filesvlen_string_dset_utc.h5 -> buildlib.win32-3.8h5pytestsdata_files
80
copying h5pytestsdata_filesvlen_string_s390x.h5 -> buildlib.win32-3.8h5pytestsdata_files
81
running build_ext
82
Loading library to get version: hdf5.dll
83
error: Unable to load dependency HDF5, make sure HDF5 is installed properly
84
error: Could not find module 'hdf5.dll' (or one of its dependencies). Try using the full path with constructor syntax.
85
----------------------------------------
86
ERROR: Failed building wheel for h5py
87
Failed to build h5py
88
ERROR: Could not build wheels for h5py which use PEP 517 and cannot be installed directly
89
Please suggest any solutions to overcome these errors?
Advertisement
Answer
Sometimes it happens due to old version of pip
upgrade pip:
JavaScript
1
2
1
pip3 install --upgrade pip
2
then try again:
JavaScript
1
2
1
pip install h5py
2
Note: make sure your python3.8 is 64bit