简体   繁体   English

Raspberry Pi - psutil安装错误

[英]Raspberry Pi - psutil install error

I'm trying to install psutil on my raspberry pi and I cant seem to get to work. 我正在尝试在我的覆盆子pi上安装psutil,我似乎无法开始工作。 If I do pip install I get this error: 如果我做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

If i try python setup.py build from the directory of the install file I get this error: 如果我从安装文件的目录尝试python setup.py build我得到此错误:

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. 您还需要安装Python开发头文件。 On Debian (Raspbian “wheezy”), install the python-dev package: 在Debian(Raspbian“wheezy”)上,安装python-dev包:

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. 并获得一些在编译Python C扩展时派上用场的软件包。

On Fedora (Pidora) the equivalent of that last command is: 在Fedora(Pidora)上,相当于最后一个命令是:

sudo yum install yum-utils
sudo yum-builddep python

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM