mpi4py 安装报错 mpi.h 文件缺失

安装 mpi4py 的时候提示

 gcc -pthread -B /root/archiconda3/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/root/archiconda3/include/python3.7m -c _configtest.c -o _configtest.o
    _configtest.c:2:10: fatal error: mpi.h: No such file or directory
     #include <mpi.h>
              ^~~~~~~
    compilation terminated.
    failure.
    removing: _configtest.c _configtest.o
    error: Cannot compile MPI programs. Check your configuration!!!

在这里插入图片描述

解决办法

原因是你的环境上缺少 mpicc这个工具,这个东西做什么的我也不清楚,其作用大概类似辅助gcc编译
安装这个环境就行 cent就使用yum就行

	apt-get install mpich 

安装完后,可以在环境中找到 mpicc工具,
在这里插入图片描述

(base) C:\Users\HS>cd C:\Users\HS\Desktop\raw转hdf5 (base) C:\Users\HS\Desktop\raw转hdf5>pip install . Processing c:\users\hs\desktop\raw转hdf5 Preparing metadata (setup.py) ... done Building wheels for collected packages: hdf5maker DEPRECATION: Building 'hdf5maker' using the legacy setup.py bdist_wheel mechanism, which will be removed in a future version. pip 25.3 will enforce this behaviour change. A possible replacement is to use the standardized build interface by setting the `--use-pep517` option, (possibly combined with `--no-build-isolation`), or adding a `pyproject.toml` file to the source tree of 'hdf5maker'. Discussion can be found at https://github.com/pypa/pip/issues/6334 Building wheel for hdf5maker (setup.py) ... error error: subprocess-exited-with-error × python setup.py bdist_wheel did not run successfully. │ exit code: 1 ╰─> [43 lines of output] C:\Users\HS\Desktop\raw转hdf5\hdf5maker\version.py:8: UserWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html. The pkg_resources package is slated for removal as early as 2025-11-30. Refrain from using this package or pin to Setuptools<81. import pkg_resources D:\anaconda3\Lib\site-packages\setuptools\dist.py:759: SetuptoolsDeprecationWarning: License classifiers are deprecated. !! ******************************************************************************** Please consider removing the following classifiers in favor of a SPDX license expression: License :: OSI Approved :: GPL License See https://packaging.python.org/en/latest/guides/writing-pyproject-toml/#license for details. ******************************************************************************** !! self._finalize_license_expression() running bdist_wheel running build running build_py creating build\lib.win-amd64-cpython-313\hdf5maker copying hdf5maker\cmd_line.py -> build\lib.win-amd64-cpython-313\hdf5maker copying hdf5maker\compare_speed.py -> build\lib.win-amd64-cpython-313\hdf5maker copying hdf5maker\convert_file_mpi.py -> build\lib.win-amd64-cpython-313\hdf5maker copying hdf5maker\formatting.py -> build\lib.win-amd64-cpython-313\hdf5maker copying hdf5maker\hdf5_file.py -> build\lib.win-amd64-cpython-313\hdf5maker copying hdf5maker\io.py -> build\lib.win-amd64-cpython-313\hdf5maker copying hdf5maker\make_mask.py -> build\lib.win-amd64-cpython-313\hdf5maker copying hdf5maker\plots.py -> build\lib.win-amd64-cpython-313\hdf5maker copying hdf5maker\raw_data_file.py -> build\lib.win-amd64-cpython-313\hdf5maker copying hdf5maker\raw_file_reader.py -> build\lib.win-amd64-cpython-313\hdf5maker copying hdf5maker\raw_master_file.py -> build\lib.win-amd64-cpython-313\hdf5maker copying hdf5maker\read_quad.py -> build\lib.win-amd64-cpython-313\hdf5maker copying hdf5maker\single_m3_read.py -> build\lib.win-amd64-cpython-313\hdf5maker copying hdf5maker\timed_read.py -> build\lib.win-amd64-cpython-313\hdf5maker copying hdf5maker\tools.py -> build\lib.win-amd64-cpython-313\hdf5maker copying hdf5maker\version.py -> build\lib.win-amd64-cpython-313\hdf5maker copying hdf5maker\__init__.py -> build\lib.win-amd64-cpython-313\hdf5maker running build_ext building '_hdf5maker' extension creating build\temp.win-amd64-cpython-313\Release\src "C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.44.35207\bin\HostX86\x64\cl.exe" /c /nologo /O2 /W3 /GL /DNDEBUG /MD -ID:\anaconda3\Lib\site-packages\numpy\_core\include -ID:\anaconda3\include -ID:\anaconda3\Include "-IC:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.44.35207\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.44.35207\ATLMFC\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Auxiliary\VS\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.26100.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.26100.0\\um" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.26100.0\\shared" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.26100.0\\winrt" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.26100.0\\cppwinrt" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\include\um" /Tcsrc/hdf5maker.c /Fobuild\temp.win-amd64-cpython-313\Release\src\hdf5maker.obj hdf5maker.c src/hdf5maker.c(9): fatal error C1083: 无法打开包括文件: “unistd.h”: No such file or directory error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2022\\BuildTools\\VC\\Tools\\MSVC\\14.44.35207\\bin\\HostX86\\x64\\cl.exe' failed with exit code 2 [end of output] note: This error originates from a subprocess, and is likely not a problem with pip. ERROR: Failed building wheel for hdf5maker Running setup.py clean for hdf5maker Failed to build hdf5maker error: failed-wheel-build-for-install × Failed to build installable wheels for some pyproject.toml based projects出现此报错应该怎么办
最新发布
08-07
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值