psutil

Matt Wheeler m at funkyhat.org
Tue Feb 27 20:30:51 EST 2018


On Wed, 28 Feb 2018, 00:49 Larry Martell, <larry.martell at gmail.com> wrote:

> On Tue, Feb 27, 2018 at 7:36 PM, José María Mateos <chema at rinzewind.org>
> wrote:
> > On Tue, Feb 27, 2018 at 07:29:50PM -0500, Larry Martell wrote:
> >> Trying to install psutil (with pip install psutil) on Red Hat EL 7.
> >> It's failing with:
> >>
> >> Python.h: No such file or directory
> >
> > Two questions come to my mind:
> >
> > - Does it work if you try to install some other package?
>
> Yes, I have installed other packages (e.g. numpy)
>

Did that install definitely involve a build from source?

> - Is `pip` by any change trying to install a Python 3 package, but you
> >   only have the libraries for Python 2 installed?
>
> No, here is the gcc command line that failed:
>
>     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=543 -DPSUTIL_LINUX=1
> -I/opt/rh/python27/root/usr/include/python2.7 -c
> psutil/_psutil_common.c -o
> build/temp.linux-x86_64-2.7/psutil/_psutil_common.o
>

Based on the include path you have here this looks like you have a non
standard python package for EL7 (in addition to the system one, or you'd be
having a worse day), which is probably the root of your problem.

Are you using python packages from scl perhaps?
If so you probably need to install python27-python-devel (found at
http://mirror.centos.org/centos/7/sclo/x86_64/rh/python27/)

> --

--
Matt Wheeler
http://funkyh.at



More information about the Python-list mailing list