community.general.easy_install module – Installs Python libraries
Note
This module is part of the community.general collection (version 10.7.5).
You might already have this collection installed if you are using the ansible package.
It is not included in ansible-core.
To check whether it is installed, run ansible-galaxy collection list.
To install it, use: ansible-galaxy collection install community.general.
You need further requirements to be able to use this module,
see Requirements for details.
To use it in a playbook, specify: community.general.easy_install.
Synopsis
- Installs Python libraries, optionally in a - virtualenv.
Requirements
The below requirements are needed on the host that executes this module.
- virtualenv 
Parameters
| Parameter | Comments | 
|---|---|
| The explicit executable or a pathname to the executable to be used to run easy_install for a specific version of Python installed in the system. For example  Default:  | |
| A Python library name. | |
| The desired state of the library.  Choices: 
 | |
| An optional  | |
| The command to create the virtual environment with. For example  Default:  | |
| Whether the virtual environment inherits packages from the global site-packages directory. Note that this setting has no effect on an already existing virtual environment, so if you want to change it, the environment must be deleted and newly created. Choices: 
 | 
Attributes
| Attribute | Support | Description | 
|---|---|---|
| Support: full | Can run in  | |
| Support: none | Will return details on what has changed (or possibly needs changing in  | 
Notes
Note
- Please note that the - easy_installmodule can only install Python libraries. Thus this module is not able to remove libraries. It is generally recommended to use the ansible.builtin.pip module which you can first install using community.general.easy_install.
- Also note that - virtualenvmust be installed on the remote host if the- virtualenvparameter is specified.
Examples
- name: Install or update pip
  community.general.easy_install:
    name: pip
    state: latest
- name: Install Bottle into the specified virtualenv
  community.general.easy_install:
    name: bottle
    virtualenv: /webapps/myapp/venv
- name: Install a python package using pyvenv as the virtualenv tool
  community.general.easy_install:
    name: package_name
    virtualenv: /opt/myenv
    virtualenv_command: pyvenv
