kiranvizru / psutil

Automatically exported from code.google.com/p/psutil
Other
0 stars 0 forks source link

Fail installing psutil on Centos #155

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Hi!
Trying install psutil on 64bit Centos 5 (python 2.4) and it fails.

1. With easy install:

sudo easy_install psutil
Password: 
Searching for psutil
Reading http://cheeseshop.python.org/pypi/psutil/
Reading http://code.google.com/p/psutil/
Reading http://cheeseshop.python.org/pypi/psutil/0.2.1
Best match: psutil 0.2.1
Downloading http://psutil.googlecode.com/files/psutil-0.2.1.tar.gz
Processing psutil-0.2.1.tar.gz
Running psutil-0.2.1/setup.py -q bdist_egg --dist-dir 
/tmp/easy_install-aOh57X/psutil-0.2.1/egg-dist-tmp-UqDYpt
psutil/_psutil_linux.c:7:20: error: Python.h: No such file or directory
In file included from psutil/_psutil_linux.c:13:
psutil/_psutil_linux.h:9: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ 
or ‘__attribute__’ before ‘*’ token
psutil/_psutil_linux.h:10: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ 
or ‘__attribute__’ before ‘*’ token
psutil/_psutil_linux.c: In function ‘ioprio_get’:
psutil/_psutil_linux.c:26: warning: implicit declaration of function 
‘syscall’
psutil/_psutil_linux.c: At top level:
psutil/_psutil_linux.c:46: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ 
or ‘__attribute__’ before ‘*’ token
psutil/_psutil_linux.c:69: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ 
or ‘__attribute__’ before ‘*’ token
psutil/_psutil_linux.c:93: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ 
or ‘__attribute__’ before ‘PsutilMethods’
psutil/_psutil_linux.c:105: error: expected specifier-qualifier-list before 
‘PyObject’
psutil/_psutil_linux.c: In function ‘init_psutil_linux’:
psutil/_psutil_linux.c:156: error: ‘PyObject’ undeclared (first use in this 
function)
psutil/_psutil_linux.c:156: error: (Each undeclared identifier is reported only 
once
psutil/_psutil_linux.c:156: error: for each function it appears in.)
psutil/_psutil_linux.c:156: error: ‘module’ undeclared (first use in this 
function)
psutil/_psutil_linux.c:156: warning: implicit declaration of function 
‘Py_InitModule’
psutil/_psutil_linux.c:156: error: ‘PsutilMethods’ undeclared (first use in 
this function)
psutil/_psutil_linux.c:161: warning: unused variable ‘st’
error: Setup script exited with error: command 'gcc' failed with exit status 1

2. From sources:

python setup.py install
running install
running build
running build_py
running build_ext
building '_psutil_linux' extension
gcc -pthread -fno-strict-aliasing -DNDEBUG -O2 -g -pipe -Wall 
-Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector 
--param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fPIC 
-I/usr/include/python2.4 -c psutil/_psutil_linux.c -o 
build/temp.linux-x86_64-2.4/psutil/_psutil_linux.o
psutil/_psutil_linux.c:7:20: error: Python.h: No such file or directory
In file included from psutil/_psutil_linux.c:13:
psutil/_psutil_linux.h:9: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ 
or ‘__attribute__’ before ‘*’ token
psutil/_psutil_linux.h:10: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ 
or ‘__attribute__’ before ‘*’ token
psutil/_psutil_linux.c: In function ‘ioprio_get’:
psutil/_psutil_linux.c:26: warning: implicit declaration of function 
‘syscall’
psutil/_psutil_linux.c: At top level:
psutil/_psutil_linux.c:46: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ 
or ‘__attribute__’ before ‘*’ token
psutil/_psutil_linux.c:69: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ 
or ‘__attribute__’ before ‘*’ token
psutil/_psutil_linux.c:93: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ 
or ‘__attribute__’ before ‘PsutilMethods’
psutil/_psutil_linux.c:105: error: expected specifier-qualifier-list before 
‘PyObject’
psutil/_psutil_linux.c: In function ‘init_psutil_linux’:
psutil/_psutil_linux.c:156: error: ‘PyObject’ undeclared (first use in this 
function)
psutil/_psutil_linux.c:156: error: (Each undeclared identifier is reported only 
once
psutil/_psutil_linux.c:156: error: for each function it appears in.)
psutil/_psutil_linux.c:156: error: ‘module’ undeclared (first use in this 
function)
psutil/_psutil_linux.c:156: warning: implicit declaration of function 
‘Py_InitModule’
psutil/_psutil_linux.c:156: error: ‘PsutilMethods’ undeclared (first use in 
this function)
psutil/_psutil_linux.c:161: warning: unused variable ‘st’
error: command 'gcc' failed with exit status 1

psutil version: psutil 0.2.1

$ cat /etc/redhat-release 
CentOS release 5.4 (Final)

$ uname -a
Linux localhost.localdomain 2.6.18-164.15.1.el5 #1 SMP Wed Mar 17 11:30:06 EDT 
2010 x86_64 x86_64 x86_64 GNU/Linux

$ python -V
Python 2.4.3

Any help will be appreciated. 

Original issue reported on code.google.com by eina...@gmail.com on 28 Mar 2011 at 8:21

GoogleCodeExporter commented 9 years ago
You need python header files in order to compile the C module extension.
I'm not sure how you do that on Centos.
On ubuntu you install them with "sudo apt-get install python-dev".

Original comment by g.rodola on 28 Mar 2011 at 8:31

GoogleCodeExporter commented 9 years ago
Thanks you very much!
Succeeded to install from sources.

P.S. FYI, but with easy_install there's still problem:
$ sudo easy_install psutil
Processing psutil
error: Couldn't find a setup script in psutil

Original comment by eina...@gmail.com on 28 Mar 2011 at 8:37

GoogleCodeExporter commented 9 years ago
Strange:

giampaolo@ubuntu:~test$ sudo easy_install-2.6 psutil
Searching for psutil
Reading http://pypi.python.org/simple/psutil/
Reading http://code.google.com/p/psutil/
Best match: psutil 0.2.1
Downloading http://psutil.googlecode.com/files/psutil-0.2.1.tar.gz
Processing psutil-0.2.1.tar.gz
Running psutil-0.2.1/setup.py -q bdist_egg --dist-dir 
/tmp/easy_install-ND0iYc/psutil-0.2.1/egg-dist-tmp-AJqm3o
psutil/_psutil_linux.c: In function ‘init_psutil_linux’:
psutil/_psutil_linux.c:161: warning: unused variable ‘st’
zip_safe flag not set; analyzing archive contents...
Adding psutil 0.2.1 to easy-install.pth file

Installed 
/usr/local/lib/python2.6/dist-packages/psutil-0.2.1-py2.6-linux-x86_64.egg
Processing dependencies for psutil
Finished processing dependencies for psutil

Original comment by g.rodola on 28 Mar 2011 at 8:42

GoogleCodeExporter commented 9 years ago
Sorry, my fault. ( I was trying to run easy_install from psutil directory ) 
This confused it.

$ cd
$ sudo easy_install psutil
Searching for psutil
Best match: psutil 0.2.1
Processing psutil-0.2.1-py2.4-linux-x86_64.egg
psutil 0.2.1 is already the active version in easy-install.pth

Using /usr/lib/python2.4/site-packages/psutil-0.2.1-py2.4-linux-x86_64.egg
Processing dependencies for psutil

Thanks for help!

Original comment by eina...@gmail.com on 28 Mar 2011 at 9:14

GoogleCodeExporter commented 9 years ago

Original comment by g.rodola on 28 Mar 2011 at 9:22

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Actually, I had the same issue and same error messages on Citrix 5.6 release, 
which is based on Centos5. Anyone could help?

# cat /etc/redhat-release 
XenServer release 5.6.199-43873p (xenenterprise)

# python -V
Python 2.4.3

# sudo easy_install psutil
Searching for psutil
Reading http://pypi.python.org/simple/psutil/
Reading http://code.google.com/p/psutil/
Best match: psutil 0.2.1
Downloading http://psutil.googlecode.com/files/psutil-0.2.1.tar.gz
Processing psutil-0.2.1.tar.gz
Running psutil-0.2.1/setup.py -q bdist_egg --dist-dir 
/tmp/easy_install-ftjfov/psutil-0.2.1/egg-dist-tmp--eofoc
psutil/_psutil_linux.c:7:20: error: Python.h: No such file or directory
In file included from psutil/_psutil_linux.c:13:
psutil/_psutil_linux.h:9: error: expected 鈥?鈥? 鈥?鈥? 鈥?鈥? 
鈥榓sm鈥?or 鈥榑_attribute__鈥?before 鈥?鈥?token
psutil/_psutil_linux.h:10: error: expected 鈥?鈥? 鈥?鈥? 鈥?鈥? 
鈥榓sm鈥?or 鈥榑_attribute__鈥?before 鈥?鈥?token
psutil/_psutil_linux.c: In function 鈥榠oprio_get鈥?
psutil/_psutil_linux.c:26: warning: implicit declaration of function 
鈥榮yscall鈥
psutil/_psutil_linux.c: At top level:
psutil/_psutil_linux.c:46: error: expected 鈥?鈥? 鈥?鈥? 鈥?鈥? 
鈥榓sm鈥?or 鈥榑_attribute__鈥?before 鈥?鈥?token
psutil/_psutil_linux.c:69: error: expected 鈥?鈥? 鈥?鈥? 鈥?鈥? 
鈥榓sm鈥?or 鈥榑_attribute__鈥?before 鈥?鈥?token
psutil/_psutil_linux.c:93: error: expected 鈥?鈥? 鈥?鈥? 鈥?鈥? 
鈥榓sm鈥?or 鈥榑_attribute__鈥?before 鈥楶sutilMethods鈥
psutil/_psutil_linux.c:105: error: expected specifier-qualifier-list before 
鈥楶yObject鈥
psutil/_psutil_linux.c: In function 鈥榠nit_psutil_linux鈥?
psutil/_psutil_linux.c:156: error: 鈥楶yObject鈥?undeclared (first use in 
this function)
psutil/_psutil_linux.c:156: error: (Each undeclared identifier is reported only 
once
psutil/_psutil_linux.c:156: error: for each function it appears in.)
psutil/_psutil_linux.c:156: error: 鈥榤odule鈥?undeclared (first use in this 
function)
psutil/_psutil_linux.c:156: warning: implicit declaration of function 
鈥楶y_InitModule鈥
psutil/_psutil_linux.c:156: error: 鈥楶sutilMethods鈥?undeclared (first use 
in this function)
psutil/_psutil_linux.c:161: warning: unused variable 鈥榮t鈥
error: Setup script exited with error: command 'gcc' failed with exit status 1

Original comment by wise...@gmail.com on 12 Apr 2011 at 10:20

GoogleCodeExporter commented 9 years ago
You need to install the Python headers, same as in the original issue report. 
If the pytthon-dev package or headers are not available then there is no 
Python.h on your system.

Original comment by jlo...@gmail.com on 13 Apr 2011 at 4:24

GoogleCodeExporter commented 9 years ago
On Centos 6 running:

  yum install python-devel

installs the python header files.

Original comment by awa...@awatts.co.uk on 21 Dec 2012 at 11:37

GoogleCodeExporter commented 9 years ago
I don't have yum...is there anyway to install python-dev with rpm? if you know 
the package for python-2.6.6 and redhat6.4

Original comment by hotsho...@gmail.com on 16 Oct 2013 at 11:15

GoogleCodeExporter commented 9 years ago
# easy_install psutil
Searching for psutil
Reading https://pypi.python.org/simple/psutil/
Download error on https://pypi.python.org/simple/psutil/: [Errno -3] Temporary 
failure in name resolution -- Some packages may not be found!
Couldn't find index page for 'psutil' (maybe misspelled?)
Scanning index of all packages (this may take a while)
Reading https://pypi.python.org/simple/
Download error on https://pypi.python.org/simple/: [Errno -3] Temporary failure 
in name resolution -- Some packages may not be found!
No local packages or download links found for psutil
error: Could not find suitable distribution for Requirement.parse('psutil')

Original comment by hotsho...@gmail.com on 16 Oct 2013 at 11:17