我在sudo apt-get install python-psutil
的RPi上安装了psutil,但它给了我v0.5.1
我想使用v2.1.1,因为它有virtual_memory()命令,其中v0.5.1没有。
尝试从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
卸载python-psutil然后执行sudo pip install psutil
但是返回时出现了同样的错误。与sudo easy_install psutil
接下来,我尝试确保安装了python-dev
和libevent-dev
。 python-dev
已经安装并更新,但libevent-dev
没有。所以我更新了它并再次尝试sudo pip install psutil
无效(同样的错误)。
我错过了什么吗?