Add pipx instructions to install guide (#80833)

pull/80867/head
Matt Martz 1 year ago committed by GitHub
parent 10d91db003
commit f4b2d4d4bb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -47,8 +47,56 @@ Ansible's community packages are distributed in two ways: a minimalist language
See the :ref:`Ansible package release status table<ansible_changelogs>` for the ``ansible-core`` version included in the package.
Installing and upgrading Ansible
================================
Installing and upgrading Ansible with pipx
==========================================
On some systems, it may not be possible to install Ansible with ``pip``, due to decisions made by the operating system. In such cases, ``pipx`` is a widely available alternative.
These instructions will not go over the steps to install ``pipx``; If those instructions are needed please continue to the `pipx installation instructions`_ for more information.
.. _pipx installation instructions: https://pypa.github.io/pipx/installation/
.. _pipx_install:
Installing Ansible
------------------
Use ``pipx`` in your environment to install the Ansible package of your choice for the current user:
.. code-block:: console
$ pipx install ansible
Alternately, you can install a specific version of ``ansible-core``:
.. code-block:: console
$ pipx install ansible-core==2.12.3
.. _pipx_upgrade:
Upgrading Ansible
-----------------
To upgrade an existing Ansible installation to the latest released version:
.. code-block:: console
$ pipx upgrade ansible
.. _pipx_inject:
Installing Extra Python Dependencies
------------------------------------
To install additional python dependencies that may be needed, with the example of installing the ``argcomplete`` python package as described below:
.. code-block:: console
$ pipx inject ansible argcomplete
Installing and upgrading Ansible with pip
=========================================
Locating Python
---------------
@ -112,23 +160,6 @@ To upgrade an existing Ansible installation in this Python environment to the la
$ python3 -m pip install --upgrade --user ansible
Confirming your installation
----------------------------
You can test that Ansible is installed correctly by checking the version:
.. code-block:: console
$ ansible --version
The version displayed by this command is for the associated ``ansible-core`` package that has been installed.
To check the version of the ``ansible`` package that has been installed:
.. code-block:: console
$ python3 -m pip show ansible
.. _development_install:
Installing for development
@ -205,6 +236,23 @@ Running the ``devel`` branch from a clone
.. _shell_completion:
Confirming your installation
============================
You can test that Ansible is installed correctly by checking the version:
.. code-block:: console
$ ansible --version
The version displayed by this command is for the associated ``ansible-core`` package that has been installed.
To check the version of the ``ansible`` package that has been installed:
.. code-block:: console
$ ansible-community --version
Adding Ansible command shell completion
=======================================
@ -215,6 +263,14 @@ For more information about installation and configuration, see the `argcomplete
Installing ``argcomplete``
--------------------------
If you chose the ``pipx`` install instructions:
.. code-block:: console
$ pipx inject ansible argcomplete
Or, if you chose the ``pip`` install instructions:
.. code-block:: console
$ python3 -m pip install --user argcomplete

Loading…
Cancel
Save