解决pip3安装esrally失败的问题
为了进行ElasticSearch的性能测试,打算安装esrally这个工具。
https://github.com/elastic/rally
按照github esrally项目主页上的要求,在centos 6的系统上安装了 python3,和pip3。
之后用 pip3 install esrally 命令按照。
安装过程中提示错误:

psutil/_psutil_linux.c:12:20: fatal error: Python.h: No such file or directory
主要的意思就是 Python.h 没有找到。
网上找到了解决方法:要安装 python-devel 库。于是用 yum 安装:
yum install python-devel -y
安装之后,重试pip3 install esrally,依然报同样的错误。
这次在网上没有找到解决办法。于是分析了一下错误,发现在 /usr/include/python2.7/ 目录下有Python.h等文件,而错误提示的/usr/include/python3.4m 目录下却没有。
于是把 /usr/include/python2.7/ 下的 .h 文件都复制到 /usr/include/python3.4m 文件夹。
再次重试pip3 install esrally。这次的错误变了:

/usr/bin/ld: cannot find -lpython3.4m
为了解决这个问题,根据提示,查看了一下 /usr/lib64 目录。

发现没有 libpython3.4m.so,但是有 libpython3.4m.so.1.0。 那问题似乎就简单了,做一个软链接即可。
ln -s /usr/lib64/libpython3.4m.so.1.0 /usr/lib64/libpython3.4m.so
再尝试一下pip3 install esrally。终于安装成功了。

以上就是问题解决过程。供参考。