编译boost遇到问题:fatal error: pyconfig.h: No such file or directory

  • Post author:
  • Post category:其他


#  cat /etc/redhat-release

CentOS Linux release 7.4.1708 (Core) 系统是这个

编译boost遇到问题:

./boost/python/detail/wrap_python.hpp:50:23: fatal error: pyconfig.h: No such file or directory

# include <pyconfig.h>

原因:

没有安装对应python的python-dev依赖,不然编译到boost python模块的时候就会出错。

python -v 查看是2.7版本的python

解决方案:

sudo yum install python-devel

注意是devel而不是dev,而ubuntu则是sudo apt-get install python-dev

查看:

ll /usr/include/python2.7/ | grep pyconfig.h 已经有了

-rw-r–r– 1 root root   162 4月   9 22:31 pyconfig.h



版权声明:本文为m0_67877471原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。