You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Ubuntu 22.04源码安装SU2遇configure错误:找不到/usr/bin/python的python-config

解决Ubuntu 22.04源码安装SU2时configure: error: cannot find python-config for /usr/bin/python问题

1. 先确认python3-config状态

执行命令检查系统是否存在Python3对应的配置工具:

which python3-config

如果无输出,说明缺少依赖包,执行以下命令安装:

sudo apt update && sudo apt install python3-dev

安装完成后再次执行which python3-config,应该会返回/usr/bin/python3-config。

2. 修复python-config找不到的问题

方法一:创建软链接

Ubuntu 22.04中python默认指向python3,但系统未提供python-config别名,直接创建软链接映射到python3-config:

sudo ln -s /usr/bin/python3-config /usr/bin/python-config

之后重新运行SU2的configure命令即可。

方法二:运行configure时指定路径

如果不想创建软链接,可直接在configure命令中指定Python配置工具路径:

./configure --with-python-config=/usr/bin/python3-config [你的其他编译参数]

或者先设置环境变量再执行:

export PYTHON_CONFIG=/usr/bin/python3-config
./configure [你的其他编译参数]

内容的提问来源于stack exchange,提问作者maurzio_show

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.04 19:25:53