fatal error pyconfig.h No such file or directory

 

#  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

 

 

经验证是可以的。 

 

posted @ 2021-02-24 14:00  凌空a  阅读(5385)  评论(0编辑  收藏  举报