首先查找系统中Python.h的位置:
dlocate Python.h
输出:
libpython3.8-dev:amd64: /usr/include/python3.8/Python.h
然后参考这个回答:
./python3.10 -m pip install --global-option=build_ext --global-option="-I/usr/include/python3.8"
输出:
WARNING: Disabling all use of wheels due to the use of --build-option / --global-option / --install-option.
Collecting OpenEXR
Using cached OpenEXR-1.3.9.tar.gz (13 kB)
Preparing metadata (setup.py) ... done
Skipping wheel build for OpenEXR, due to binaries being disabled for it.
Installing collected packages: OpenEXR
Running setup.py install for OpenEXR ... done
Successfully installed OpenEXR-1.3.9
成功安装!