Raspberry Pi - psutil安装错误

时间:2013-08-14 16:40:47

标签: python raspberry-pi

我正在尝试在我的覆盆子pi上安装psutil,我似乎无法开始工作。如果我做pip安装,我会收到此错误:

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

如果我从安装文件的目录中尝试python setup.py构建,我会收到此错误:

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

如果有人可以帮我安装,那就太好了。

1 个答案:

答案 0 :(得分:25)

您还需要安装Python开发标题。在Debian(Raspbian“wheezy”)上,安装python-dev包:

sudo apt-get install python-dev

或运行:

sudo apt-get build-dep python

并获得一些在编译Python C扩展时派上用场的软件包。

在Fedora(Pidora)上,相当于最后一个命令:

sudo yum install yum-utils
sudo yum-builddep python