unixsurfer / haproxytool

A tool to interact with HAProxy via stats socket
Apache License 2.0
85 stars 8 forks source link

Unable to install on centos 7 with python 2.7. #4

Closed rajashekhargundeti closed 7 years ago

rajashekhargundeti commented 7 years ago

[root@0b04fe0b9fc6 tmp]# pip install haproxytool Collecting haproxytool Downloading haproxytool-0.5.3.tar.gz Collecting docopt (from haproxytool) Downloading docopt-0.6.2.tar.gz Collecting haproxyadmin (from haproxytool) Downloading haproxyadmin-0.2.1.tar.gz (55kB) 100% |################################| 61kB 223kB/s Collecting six (from haproxytool) Downloading six-1.10.0-py2.py3-none-any.whl Collecting psutil (from haproxyadmin->haproxytool) Downloading psutil-5.2.2.tar.gz (348kB) 100% |################################| 358kB 344kB/s Building wheels for collected packages: haproxytool, docopt, haproxyadmin, psutil Running setup.py bdist_wheel for haproxytool ... done Stored in directory: /root/.cache/pip/wheels/76/3e/30/9071e51c17d365a49bc601d204c6048ad2ba9ad58e4ed2f680 Running setup.py bdist_wheel for docopt ... done Stored in directory: /root/.cache/pip/wheels/b2/16/5f/c33a2bb5f2dce71205f8e65cbfd05647d79d441282be31fd82 Running setup.py bdist_wheel for haproxyadmin ... done Stored in directory: /root/.cache/pip/wheels/d7/56/fb/d4a44b0247c689774ed187a93171455575dc4aefda73d64d05 Running setup.py bdist_wheel for psutil ... error Complete output from command /usr/bin/python -u -c "import setuptools, tokenize;file='/tmp/pip-build-lZufwR/psutil/setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" bdist_wheel -d /tmp/tmpFuti3Npip-wheel- -- python-tag cp27: running bdist_wheel running build running build_py creating build creating build/lib.linux-x86_64-2.7 creating build/lib.linux-x86_64-2.7/psutil copying psutil/_psosx.py -> build/lib.linux-x86_64-2.7/psutil copying psutil/init.py -> build/lib.linux-x86_64-2.7/psutil copying psutil/_pslinux.py -> build/lib.linux-x86_64-2.7/psutil copying psutil/_psbsd.py -> build/lib.linux-x86_64-2.7/psutil copying psutil/_psposix.py -> build/lib.linux-x86_64-2.7/psutil copying psutil/_common.py -> build/lib.linux-x86_64-2.7/psutil copying psutil/_compat.py -> build/lib.linux-x86_64-2.7/psutil copying psutil/_pswindows.py -> build/lib.linux-x86_64-2.7/psutil copying psutil/_pssunos.py -> build/lib.linux-x86_64-2.7/psutil creating build/lib.linux-x86_64-2.7/psutil/tests copying psutil/tests/test_posix.py -> build/lib.linux-x86_64-2.7/psutil/tests copying psutil/tests/init.py -> build/lib.linux-x86_64-2.7/psutil/tests copying psutil/tests/runner.py -> build/lib.linux-x86_64-2.7/psutil/tests copying psutil/tests/test_system.py -> build/lib.linux-x86_64-2.7/psutil/tests copying psutil/tests/test_bsd.py -> build/lib.linux-x86_64-2.7/psutil/tests copying psutil/tests/test_misc.py -> build/lib.linux-x86_64-2.7/psutil/tests copying psutil/tests/test_memory_leaks.py -> build/lib.linux-x86_64-2.7/psutil/tests copying psutil/tests/test_windows.py -> build/lib.linux-x86_64-2.7/psutil/tests copying psutil/tests/test_sunos.py -> build/lib.linux-x86_64-2.7/psutil/tests copying psutil/tests/test_linux.py -> build/lib.linux-x86_64-2.7/psutil/tests copying psutil/tests/test_process.py -> build/lib.linux-x86_64-2.7/psutil/tests copying psutil/tests/test_osx.py -> build/lib.linux-x86_64-2.7/psutil/tests running build_ext building 'psutil._psutil_linux' extension creating build/temp.linux-x86_64-2.7 creating build/temp.linux-x86_64-2.7/psutil gcc -pthread -fno-strict-aliasing -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord -gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -DPSUTIL_POSIX=1 -DPSUTIL_VERSION=522 -DPSUTIL_L INUX=1 -I/usr/include/python2.7 -c psutil/_psutil_linux.c -o build/temp.linux-x86_64-2.7/psutil/_psutil_linux.o psutil/_psutil_linux.c:12:20: fatal error: Python.h: No such file or directory

include

                  ^

compilation terminated. error: command 'gcc' failed with exit status 1


Failed building wheel for psutil Running setup.py clean for psutil Successfully built haproxytool docopt haproxyadmin Failed to build psutil Installing collected packages: docopt, six, psutil, haproxyadmin, haproxytool Running setup.py install for psutil ... error Complete output from command /usr/bin/python -u -c "import setuptools, tokenize;file='/tmp/pip-build-lZufwR/psutil/setup.py';f=getattr(tokenize , 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" install --record /tmp/pip-kQIu6K-record/ install-record.txt --single-version-externally-managed --compile: running install running build running build_py creating build creating build/lib.linux-x86_64-2.7 creating build/lib.linux-x86_64-2.7/psutil copying psutil/_psosx.py -> build/lib.linux-x86_64-2.7/psutil copying psutil/init.py -> build/lib.linux-x86_64-2.7/psutil copying psutil/_pslinux.py -> build/lib.linux-x86_64-2.7/psutil copying psutil/_psbsd.py -> build/lib.linux-x86_64-2.7/psutil copying psutil/_psposix.py -> build/lib.linux-x86_64-2.7/psutil copying psutil/_common.py -> build/lib.linux-x86_64-2.7/psutil copying psutil/_compat.py -> build/lib.linux-x86_64-2.7/psutil copying psutil/_pswindows.py -> build/lib.linux-x86_64-2.7/psutil copying psutil/_pssunos.py -> build/lib.linux-x86_64-2.7/psutil creating build/lib.linux-x86_64-2.7/psutil/tests copying psutil/tests/test_posix.py -> build/lib.linux-x86_64-2.7/psutil/tests copying psutil/tests/init.py -> build/lib.linux-x86_64-2.7/psutil/tests copying psutil/tests/runner.py -> build/lib.linux-x86_64-2.7/psutil/tests copying psutil/tests/test_system.py -> build/lib.linux-x86_64-2.7/psutil/tests copying psutil/tests/test_bsd.py -> build/lib.linux-x86_64-2.7/psutil/tests copying psutil/tests/test_misc.py -> build/lib.linux-x86_64-2.7/psutil/tests copying psutil/tests/test_memory_leaks.py -> build/lib.linux-x86_64-2.7/psutil/tests copying psutil/tests/test_windows.py -> build/lib.linux-x86_64-2.7/psutil/tests copying psutil/tests/test_sunos.py -> build/lib.linux-x86_64-2.7/psutil/tests copying psutil/tests/test_linux.py -> build/lib.linux-x86_64-2.7/psutil/tests copying psutil/tests/test_process.py -> build/lib.linux-x86_64-2.7/psutil/tests copying psutil/tests/test_osx.py -> build/lib.linux-x86_64-2.7/psutil/tests running build_ext building 'psutil._psutil_linux' extension creating build/temp.linux-x86_64-2.7 creating build/temp.linux-x86_64-2.7/psutil gcc -pthread -fno-strict-aliasing -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -greco rd-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-stro ng --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -DPSUTIL_POSIX=1 -DPSUTIL_VERSION=522 -DPSUTIL _LINUX=1 -I/usr/include/python2.7 -c psutil/_psutil_linux.c -o build/temp.linux-x86_64-2.7/psutil/_psutil_linux.o psutil/_psutil_linux.c:12:20: fatal error: Python.h: No such file or directory

include

                    ^
compilation terminated.
error: command 'gcc' failed with exit status 1

----------------------------------------

Command "/usr/bin/python -u -c "import setuptools, tokenize;file='/tmp/pip-build-lZufwR/psutil/setup.py';f=getattr(tokenize, 'open', open)(file );code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" install --record /tmp/pip-kQIu6K-record/install-record.txt --sin gle-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-lZufwR/psutil/ [root@0b04fe0b9fc6 tmp]# python -V Python 2.7.5 [root@0b04fe0b9fc6 tmp]# pip -V pip 9.0.1 from /usr/lib/python2.7/site-packages (python 2.7)

unixsurfer commented 7 years ago

During the installation of haproxytool the psutil package is being installed, which requires python headers( psutil/_psutil_linux.c:12:20: fatal error: Python.h: No such file or directory) files to be present as psutil package is being compiled. Please install python development package.