我试图在macos终端中使用pip命令安装pyhdf(https://pypi.org/project/pyhdf/)包,但我面临以下错误:
Collecting pyhdf
Using cached pyhdf-0.11.3.tar.gz (146 kB)
Installing build dependencies ... done
Getting requirements to build wheel ... done
Installing backend dependencies ... done
Preparing metadata (pyproject.toml) ... done
Building wheels for collected packages: pyhdf
Building wheel for pyhdf (pyproject.toml) ... error
error: subprocess-exited-with-error
× Building wheel for pyhdf (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [38 lines of output]
running bdist_wheel
running build
running build_py
creating build
creating build/lib.macosx-11.1-arm64-cpython-311
creating build/lib.macosx-11.1-arm64-cpython-311/pyhdf
copying pyhdf/V.py -> build/lib.macosx-11.1-arm64-cpython-311/pyhdf
copying pyhdf/error.py -> build/lib.macosx-11.1-arm64-cpython-311/pyhdf
copying pyhdf/HDF.py -> build/lib.macosx-11.1-arm64-cpython-311/pyhdf
copying pyhdf/__init__.py -> build/lib.macosx-11.1-arm64-cpython-311/pyhdf
copying pyhdf/VS.py -> build/lib.macosx-11.1-arm64-cpython-311/pyhdf
copying pyhdf/six.py -> build/lib.macosx-11.1-arm64-cpython-311/pyhdf
copying pyhdf/SD.py -> build/lib.macosx-11.1-arm64-cpython-311/pyhdf
copying pyhdf/HC.py -> build/lib.macosx-11.1-arm64-cpython-311/pyhdf
copying pyhdf/hdfext.py -> build/lib.macosx-11.1-arm64-cpython-311/pyhdf
copying pyhdf/test_SD.py -> build/lib.macosx-11.1-arm64-cpython-311/pyhdf
running egg_info
writing pyhdf.egg-info/PKG-INFO
writing dependency_links to pyhdf.egg-info/dependency_links.txt
writing top-level names to pyhdf.egg-info/top_level.txt
reading manifest file 'pyhdf.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
no previously-included directories found matching 'doc/_build'
adding license file 'LICENSE'
adding license file 'AUTHORS'
writing manifest file 'pyhdf.egg-info/SOURCES.txt'
copying pyhdf/hdfext.i -> build/lib.macosx-11.1-arm64-cpython-311/pyhdf
copying pyhdf/hdfext_wrap.c -> build/lib.macosx-11.1-arm64-cpython-311/pyhdf
running build_ext
building 'pyhdf._hdfext' extension
creating build/temp.macosx-11.1-arm64-cpython-311
creating build/temp.macosx-11.1-arm64-cpython-311/pyhdf
clang -DNDEBUG -fwrapv -O2 -Wall -fPIC -O2 -isystem /Users/kamran/anaconda3/include -arch arm64 -fPIC -O2 -isystem /Users/kamran/anaconda3/include -arch arm64 -I/private/var/folders/dx/c0jyd4_j1952tqyy_9_6bg0h0000gn/T/pip-build-env-1wj7gp28/overlay/lib/python3.11/site-packages/numpy/core/include -I/Users/kamran/anaconda3/include/python3.11 -c pyhdf/hdfext_wrap.c -o build/temp.macosx-11.1-arm64-cpython-311/pyhdf/hdfext_wrap.o -DNOSZIP
pyhdf/hdfext_wrap.c:3677:10: fatal error: 'hdf.h' file not found
#include "hdf.h"
^~~~~~~
1 error generated.
error: command '/usr/bin/clang' failed with exit code 1
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for pyhdf
Failed to build pyhdf
ERROR: Could not build wheels for pyhdf, which is required to install pyproject.toml-based projects
字符串
这个软件包很容易安装在windows和Linux中,但在macOS中不工作。有人能提供这个错误的解决方案吗?
1条答案
按热度按时间ktecyv1j1#
您的系统上缺少
hdf.h
头文件,这些头文件是为pyhdf构建wheel的依赖项。尝试
brew install hdf5
或brew install hdf
pip install pyhdf
又来了