I'm trying to install psutil on my raspberry pi and I cant seem to get to work. If I do 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 python setup.py build from the directory of the install file 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 some one could help me get this installed that would be great.
You need to install the Python development headers too. On Debian (Raspbian “wheezy”), install the python-dev
package:
sudo apt-get install python-dev
or run:
sudo apt-get build-dep python
and get a few more packages that come in handy when compiling Python C extensions. Replace python
with python3
on more recent Debian releases.
On Fedora (Pidora) the equivalent of that last command is:
sudo yum install yum-utils
sudo yum-builddep python
Here too you may want to replace python
with python3
if your system is more recent.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With