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

Ubuntu下编译安装graph-tool 2.26时./configure报错求助

Fixing Boost Python Library Mismatch When Compiling graph-tool 2.26 on Ubuntu

Hey there, I’ve dealt with this exact issue before while compiling graph-tool on Ubuntu—let’s get you past this configure error. The problem here is that the configure script is hunting for the wrong Boost Python library variant, probably because it’s defaulting to Python 2.7 but your setup is using Python 3 (or vice versa). Here’s how to fix it:

Step 1: Verify Your Python Version & Installed Boost Libraries

First, confirm which Python version you’re targeting:

python3 --version  # If you're using Python 3
# OR
python --version   # If you're still on Python 2

Then check which Boost Python packages are installed on your system:

dpkg -l | grep libboost-python

If you’re using Python 3 and don’t see libboost-python3-dev in the output, install it first:

sudo apt update && sudo apt install libboost-python3-dev

Step 2: Force Configure to Use the Correct Python Version

If installing the right dev package doesn’t automatically fix the detection, tell the configure script explicitly which Python version to use. For Python 3, run:

./configure --with-python=python3

If you need to be more specific (e.g., your Python 3 version is 3.8), you can specify the exact Boost library suffix too:

./configure PYTHON_VERSION=3.8 BOOST_PYTHON_LIB=boost_python38

Step 3: Fix PKG_CONFIG_PATH (If Needed)

Occasionally, the configure script can’t find Boost’s pkg-config files. Set the path manually to the standard Ubuntu location:

export PKG_CONFIG_PATH=/usr/lib/x86_64-linux-gnu/pkgconfig/
./configure --with-python=python3

Why This Happens

graph-tool 2.26’s configure script tries a few common Boost Python library names by default (like boost_python or boost_python-py27), but if your system uses Python 3, the correct library will have a 3 in the name (e.g., boost_python3, boost_python38). The script doesn’t always guess this correctly, so we have to point it in the right direction.

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.05.22 08:07:54