Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fail installing psutil on Centos #155

Closed
giampaolo opened this issue May 23, 2014 · 10 comments
Closed

Fail installing psutil on Centos #155

giampaolo opened this issue May 23, 2014 · 10 comments

Comments

@giampaolo
Copy link
Owner

From [email protected] on March 28, 2011 10:21:11

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 
https://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: http://code.google.com/p/psutil/issues/detail?id=155

@giampaolo
Copy link
Owner Author

From g.rodola on March 28, 2011 01:31:30

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".

@giampaolo
Copy link
Owner Author

From [email protected] on March 28, 2011 01:37:07

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

@giampaolo
Copy link
Owner Author

From g.rodola on March 28, 2011 01:42:24

Strange:

giampaolo@ubuntu:~test$ sudo easy_install-2.6 psutil
Searching for psutil
Reading http://pypi.python.org/simple/psutil/ Reading 
https://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

@giampaolo
Copy link
Owner Author

From [email protected] on March 28, 2011 02:14:31

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!

@giampaolo
Copy link
Owner Author

From g.rodola on March 28, 2011 02:22:20

Status: Invalid

@giampaolo
Copy link
Owner Author

From [email protected] on April 12, 2011 15:20:00

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 
https://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

@giampaolo
Copy link
Owner Author

From [email protected] on April 12, 2011 21:24:11

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.

@giampaolo
Copy link
Owner Author

From [email protected] on December 21, 2012 03:37:00

On Centos 6 running:

  yum install python-devel

installs the python header files.

@giampaolo
Copy link
Owner Author

From [email protected] on October 16, 2013 16:15:58

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

@giampaolo
Copy link
Owner Author

From [email protected] on October 16, 2013 16:17:42

# 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')

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant