且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

无法在OS X上安装netCDF4 python软件包

更新时间:2023-11-10 11:17:28

您可能需要将HDF5_DIR环境变量设置为安装HDF5的位置.它正在寻找标准的安装路径,而没有找到HDF5的标头-因此至少有一个错误.

You might need to set the HDF5_DIR environment variable to the location where you install HDF5; it's looking in the standard install paths and not finding the headers for HDF5 - hence at least one of your errors.

您可以在致电pip之前简单地进行设置:

You can simply set it before calling pip:

HDF5_DIR=/usr/local/hdf5 pip install netCDF4

或导出它,然后致电pip:

or export it and then call pip:

export HDF5_DIR=/usr/local/hdf5
pip install netCDF4