How to Install psutil in Python
Cross-platform lib for process and system monitoring.
pip install psutil
What is psutil?
Cross-platform lib for process and system monitoring.
psutil (process and system utilities) is a cross-platform library for retrieving information on running processes and system utilization (CPU, memory, disks, network, sensors) in Python. It is useful mainly for system monitoring, profiling and limiting process resources and management of running processes. It implements many functionalities offered by classic UNIX command line tools such as ps, top, iotop, lsof, netstat, ifconfig, free and others. psutil currently supports the following platforms:
- Linux - Windows - macOS - FreeBSD, OpenBSD, NetBSD - Sun Solaris - AIX
Supported Python versions are cPython 3.6+ and . Latest psutil version supporting Python 2.7 is .
Quick Start
Minimal example to get started with psutil:
import psutil
print(f"CPU: {psutil.cpu_percent()}%")
mem = psutil.virtual_memory()
print(f"RAM: {mem.used / 1e9:.1f}GB / {mem.total / 1e9:.1f}GB")
disk = psutil.disk_usage("/")
print(f"Disk free: {disk.free / 1e9:.0f}GB")
Installation
pip (standard)
pip install psutil
Virtual environment (recommended)
python -m venv venv
source venv/bin/activate # Windows: venv\Scripts\activate
pip install psutil
pip3
pip3 install psutil
conda
conda install -c conda-forge psutil
Poetry
poetry add psutil
Verify the Installation
After installing, confirm the package is available:
python -c "import psutil; print(psutil.__version__)"
If this prints a version number, installation succeeded. If you see a ModuleNotFoundError, see the errors section below.
Installation Errors
Common errors when installing psutil with pip.
ModuleNotFoundError: No module named 'psutil'
Cause: The package is not installed in the current Python environment.
Fix: Run pip install psutil. If using a virtual environment, ensure it is activated first.
ModuleNotFoundError: No module named 'psutil' (installed but still failing)
Cause: pip installed the package into a different Python than the one running your script.
Fix: Use python -m pip install psutil to install into the interpreter you are running.
ImportError: cannot import name 'X' from 'psutil'
Cause: The function or class does not exist in the installed version.
Fix: Check the version with pip show psutil and upgrade with pip install --upgrade psutil.
pip: command not found
Cause: pip is not in PATH or Python was not added to PATH during installation.
Fix: Try python -m pip install psutil. On macOS/Linux try pip3.
PermissionError: [Errno 13] Permission denied
Cause: No write access to the system Python package directory.
Fix: Use a virtual environment, or add --user: pip install --user psutil
SSL: CERTIFICATE_VERIFY_FAILED
Cause: pip cannot verify PyPI's SSL certificate — common behind corporate proxies.
Fix: Try: pip install --trusted-host pypi.org --trusted-host files.pythonhosted.org psutil
Recent Releases
| Version | Released |
|---|---|
7.2.2 latest |
2026-01-28 |
7.2.1 |
2025-12-29 |
7.2.0 |
2025-12-23 |
7.1.3 |
2025-11-02 |
7.1.2 |
2025-10-25 |
Manage psutil
Upgrade to latest version
pip install --upgrade psutil
Install a specific version
pip install psutil==7.2.2
Uninstall
pip uninstall psutil
Check what is installed
pip show psutil