Raspberry Pi installation error - psutil

I am trying to install psutil on my raspberry pi, and I cannot get myself to work. If I install pip install, I get this error:

psutil/_psutil_linux.c:10:20: fatal error: Python.h: No such file or directory compilation terminated. error: command 'gcc' failed with exit status 1 ---------------------------------------- Command /usr/bin/python -c "import setuptools;__file__='/home/pi/build/psutil/setup.py';exec(compile(open(__file__).read().replace('\r\n ', '\n'), __file__, 'exec'))" install --single-version-externally-managed --record /tmp/pip-V39ila-record/install-record.txt failed with error code 1 in /home/pi/build/psutil Storing complete log in /root/.pip/pip.log 

If I try to create python setup.py from the installation file directory, I get this error:

 psutil/_psutil_linux.c:10:20: fatal error: Python.h: No such file or directory compilation terminated. error: command 'gcc' failed with exit status 1 

if someone can help me fix this, it would be great.

+7
python raspberry-pi
source share
1 answer

You also need to set the Python development headers. In Debian (Raspbian "wheezy") install the python-dev package:

 sudo apt-get install python-dev 

or execute:

 sudo apt-get build-dep python 

and get some more packages that come in handy when compiling Python C extensions.

In Fedora (Pidora), the equivalent of the last command is:

 sudo yum install yum-utils sudo yum-builddep python 
+24
source share

All Articles