我在我的 RPi 上安装了 psutil,sudo apt-get install python-psutil
但它给了我 v0.5.1
我想使用 v2.1.1,因为它有 v0.5.1 没有的 virtual_memory() 命令。
尝试从 PIP 升级 psutil 时,sudo pip install --upgrade psutil
它开始安装然后退出并出现以下错误:
pi@raspbmc:~$ sudo pip install --upgrade psutil
Downloading/unpacking psutil from https://pypi.python.org/packages/source/p/psutil/psutil-2.1.1.tar.gz#md5=72a6b15d589fab11f6ca245b775bc3c6
Downloading psutil-2.1.1.tar.gz (216kB): 216kB downloaded
Running setup.py (path:/tmp/pip_build_root/psutil/setup.py) egg_info for package psutil
warning: no previously-included files matching '*' found under directory 'docs/_build'
Installing collected packages: psutil
Found existing installation: psutil 0.5.1
Can't uninstall 'psutil'. No files were found to uninstall.
Running setup.py install for psutil
building '_psutil_linux' extension
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/python2.7 -c psutil/_psutil_linux.c -o build/temp.linux-armv6l-2.7/psutil/_psutil_linux.o
In file included from /usr/include/linux/kernel.h:4:0,
from /usr/include/arm-linux-gnueabihf/sys/sysinfo.h:25,
from psutil/_psutil_linux.c:21:
/usr/include/linux/sysinfo.h:8:2: error: unknown type name '__kernel_long_t'
/usr/include/linux/sysinfo.h:9:2: error: unknown type name '__kernel_ulong_t'
/usr/include/linux/sysinfo.h:10:2: error: unknown type name '__kernel_ulong_t'
/usr/include/linux/sysinfo.h:11:2: error: unknown type name '__kernel_ulong_t'
/usr/include/linux/sysinfo.h:12:2: error: unknown type name '__kernel_ulong_t'
/usr/include/linux/sysinfo.h:13:2: error: unknown type name '__kernel_ulong_t'
/usr/include/linux/sysinfo.h:14:2: error: unknown type name '__kernel_ulong_t'
/usr/include/linux/sysinfo.h:15:2: error: unknown type name '__kernel_ulong_t'
/usr/include/linux/sysinfo.h:18:2: error: unknown type name '__kernel_ulong_t'
/usr/include/linux/sysinfo.h:19:2: error: unknown type name '__kernel_ulong_t'
/usr/include/linux/sysinfo.h:21:22: error: '__kernel_ulong_t' undeclared here (not in a function)
psutil/_psutil_linux.c: In function 'init_psutil_linux':
psutil/_psutil_linux.c:475:5: warning: overflow in implicit constant conversion [-Woverflow]
error: command 'gcc' failed with exit status 1
sudo apt-get remove --purge python-psutil
我尝试使用then卸载 python-psutilsudo pip install psutil
但返回相同的错误。同样的故事sudo easy_install psutil
接下来,我试图确保我已经安装python-dev
并libevent-dev
安装了。python-dev
已经安装和更新但libevent-dev
没有。所以我更新了它并sudo pip install psutil
再次尝试无济于事(同样的错误)。
我错过了什么吗?