psutil是Python的一个跨平台监控模块,可以监控操作系统的任意信息,包括内存、CPU、用户等等
也是作为Python系统管理员的必学的一个包,由于是跨平台的,这就意味着无论在Linux上还是WIndows或者MAC上,都可以使用psutil包。
安装Python pip 参考https://blog.csdn.net/totti31/article/details/84558019
以管理员身份打开cmd,进入安装好的Pyhton目录
先查找psutil,再安装。
C:\Program Files\Python37>pip search psutil
django-expvar-psutil (0.1.0) - Django expvar endpoint psutil plugin
psutil (5.4.8) - Cross-platform lib for process and system monitoring in Python.
metlog-psutils (0.1) - PSUtils extensions to metrics logging
psrv (0.0.1) - A simple psutil web front end
procinfo (0.0.4) - wrapper around psutil for ease of use
pyl0n (0.0.7) - Use psutils to send data to Graphite Backend
pylibratometrics (0.6) - Simple script to send psutil (host network/cpu/disk) stats into Librato
You are using pip version 10.0.1, however version 18.1 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.
C:\Program Files\Python37>pip install psutil
Collecting psutil
Downloading https://files.pythonhosted.org/packages/50/00/ae52663b879333aa5c65fc9a87ddc24169f8fdd1831762a1ba9c9be7740d/psutil-5.4.8-cp37-cp37m-win_amd64.whl (226kB)
100% |████████████████████████████████| 235kB 1.2MB/s
Installing collected packages: psutil
Successfully installed psutil-5.4.8
You are using pip version 10.0.1, however version 18.1 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.
看到成功就安装好了。