How to Install ansible in Python

v13.5.0 CLI & Utilities Python >=3.12 GPL-3.0-or-later

Radically simple IT automation

Install pip install ansible

What is ansible?

Radically simple IT automation

SPDX-License-Identifier: GPL-3.0-or-later SPDX-FileCopyrightText: Ansible Project, 2020

Ansible is a radically simple IT automation system. It handles configuration management, application deployment, cloud provisioning, ad-hoc task execution, network automation, and multi-node orchestration. Ansible makes complex changes like zero-downtime rolling updates with load balancers easy. More information on the Ansible .

This is the `` community package. The `` python package contains a set of independent Ansible collections that are curated by the community, and it pulls in . The `` python package contains the core runtime and CLI tools, such as ``, while the `` package contains extra modules, plugins, and roles.

Quick Start

Minimal example to get started with ansible:

import ansible

print(ansible.__version__)

Installation

pip (standard)

pip install ansible

Virtual environment (recommended)

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

pip3

pip3 install ansible

conda

conda install -c conda-forge ansible

Poetry

poetry add ansible

Dependencies

Installing ansible will also install these packages:

Verify the Installation

After installing, confirm the package is available:

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

ModuleNotFoundError: No module named 'ansible'

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

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

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

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

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

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

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

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 ansible

Recent Releases

VersionReleased
14.0.0a1 2026-04-07
13.5.0 latest 2026-03-25
13.4.0 2026-02-24
13.3.0 2026-01-29
13.2.0 2025-12-30

Full release history on PyPI →

Manage ansible

Upgrade to latest version

pip install --upgrade ansible

Install a specific version

pip install ansible==13.5.0

Uninstall

pip uninstall ansible

Check what is installed

pip show ansible

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