可能的报错如下:
error: Unable to load dependency HDF5, make sure HDF5 is installed properly
error: libhdf5.so: cannot open shared object file: No such file or directory
----------------------------------------
ERROR: Failed building wheel for h5py
Failed to build h5py
ERROR: Could not build wheels for h5py which use PEP 517 and cannot be installed directly
已经尝试过的办法:
- 降低安装h5py的等级:
pip install h5py==2.10 - 升级pip、wheel、setuptools:
pip install --upgrade pip setuptools wheel - 换源
- no-cache安装:
pip install h5py --no-cache-dir ………
均未解决问题
最终解决办法: 直接用apt install 安装:
sudo apt install python3-h5py
安装后,pip list 中可以查到已安装包列表中有h5py了;进入python3,尝试import h5py ,成功!
|