RaspberryPi - psutil 2.1.1安装错误

时间:2014-09-12 15:05:13

标签: python python-2.7 install raspberry-pi psutil

我在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-devlibevent-devpython-dev已经安装并更新,但libevent-dev没有。所以我更新了它并再次尝试sudo pip install psutil无效(同样的错误)。

我错过了什么吗?

0 个答案:

没有答案