python - 无法构建 boost python 库(致命错误:pyconfig.h:没有这样的文件或目录)
问题描述
我正在尝试在我的 ubuntu 上构建 boost python 库。但是,当我执行
./b2 --with-python
它总是返回与我相关的错误
./boost/python/detail/wrap_python.hpp:57:11: fatal error: pyconfig.h: No such file or directory
# include <pyconfig.h>
^~~~~~~~~~~~
我尝试在网上查找,例如,https://github.com/boostorg/build/issues/289
按照他们的建议,我检查了我的“project-config.jam”,我发现
# Python configuration
import python ;
if ! [ python.configured ]
{
using python : 3.7 : /home/lowlimb/anaconda3 :/home/lowlimb/anaconda3/include/python3.7m;
}
这是正确的,因此我真的不知道如何解决这个问题。谁能给我一些建议?
解决方案
除了按照其他答案的建议安装 python 开发库之外,您还可以直接指定 python 路径:
CPLUS_INCLUDE_PATH=/usr/include/python3.7 make
或者在你的情况下是这样的:
CPLUS_INCLUDE_PATH=/home/lowlimb/anaconda3/include/python3.7 ./b2
当我使用 Boost Python 编译项目时,这对我有用,但我遇到了同样的错误。
推荐阅读
- angular6 - 角度 6 将 html 转换为图像
- c# - 如何在网格视图中选择特定的单元格值
- javascript - 用玩笑和酶错误反应应用程序测试
- java - JAVA:程序在终端中工作,但不在 Visual Studio 代码中:Mac OS
- python - 基于正则表达式的熊猫数据框条件
- android - 未检测到原始图像 ExifInterface
- vue.js - 如何在 vuejs 中克隆数据?
- android - 如何在 Android 中使用 LocationMarnager#getCurrentLocation
- android - 如何使用 Android MediaPlayer 按字节块播放音频数据
- ios - 如何解决保存在表格视图上显示的数据的问题?