How to Install attrs in Python

v26.1.0 General Purpose Python >=3.9

Classes Without Boilerplate

Install pip install attrs

What is attrs?

Classes Without Boilerplate

attrs is the Python package that will bring back the joy of writing classes by relieving you from the drudgery of implementing object protocols (aka dunder methods). Trusted by NASA for Mars missions since 2020!

Its main goal is to help you to write concise and correct software without slowing down your code.

attrs would not be possible without our amazing sponsors. Especially those generously supporting us at the The Organization tier and higher:

Quick Start

Minimal example to get started with attrs:

import attrs

print(attrs.__version__)

Installation

pip (standard)

pip install attrs

Virtual environment (recommended)

python -m venv venv
source venv/bin/activate   # Windows: venv\Scripts\activate
pip install attrs

pip3

pip3 install attrs

conda

conda install -c conda-forge attrs

Poetry

poetry add attrs

Verify the Installation

After installing, confirm the package is available:

python -c "import attrs; print(attrs.__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 attrs with pip.

ModuleNotFoundError: No module named 'attrs'

Cause: The package is not installed in the current Python environment.

Fix: Run pip install attrs. If using a virtual environment, ensure it is activated first.

ModuleNotFoundError: No module named 'attrs' (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 attrs to install into the interpreter you are running.

ImportError: cannot import name 'X' from 'attrs'

Cause: The function or class does not exist in the installed version.

Fix: Check the version with pip show attrs and upgrade with pip install --upgrade attrs.

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 attrs. 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 attrs

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 attrs

Recent Releases

VersionReleased
26.1.0 latest 2026-03-19
25.4.0 2025-10-06
25.3.0 2025-03-13
25.2.0 2025-03-12
25.1.0 2025-01-25

Full release history on PyPI →

Manage attrs

Upgrade to latest version

pip install --upgrade attrs

Install a specific version

pip install attrs==26.1.0

Uninstall

pip uninstall attrs

Check what is installed

pip show attrs

Last updated: 2026-04-11 • Data from PyPI