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

 

 

经验证是可以的。 

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM