linux中maven打包时报错:
psutils-compile:
[exec] psutil/_psutil_linux.c:12:20: 错误:Python.h:没有那个文件或目录
[exec] In file included from psutil/_psutil_linux.c:23:
[exec] psutil/_psutil_linux.h:11: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
[exec] psutil/_psutil_linux.h:12: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
[exec] psutil/_psutil_linux.h:13: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
[exec] psutil/_psutil_linux.h:14: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
[exec] psutil/_psutil_linux.h:18: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
解决方法:
解决方法是安装python-devel,这是Python的头文件和静态库包:
1.可以先查看一下含python-devel的包
yum search python | grep python-devel
2.64位安装python-devel.x86_64,32位安装python-devel.i686,我这里安装:
sudo yum install python-devel.x86_64