Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ansible: How to pip install with --upgrade

Tags:

I want to pip install with --upgrade, using Ansible.

What's the syntax?

like image 823
FuzzyAmi Avatar asked Dec 04 '17 11:12

FuzzyAmi


People also ask

How do you upgrade pip on ansible?

Prerequisites for installing pip: If pip is not already have been installed on your system, then you must execute upcoming commands to install all package into your system. Install Ansible with pip package: After passing the installation of pip software , you can install Ansible.

How do I install Ansible pip module?

1 – The pip package should be installed on the remote server already. You can use the Ansible apt module or similar to install this as a part of a playbook if needed. 2 – Virtualenv package should already be installed on the remote servers if you need to manage the packages in the Python virtual environment.

How do I use the pip command to upgrade?

Updating Pip When an update for pip is available, and you run a pip command, you will see a message that says, “You are using pip version xy. a, however version xy. b is available.” You can run “pip install --upgrade pip” to install and use the new version of pip.


2 Answers

- name: install the package, force upgrade   pip:      name: <your package name>     state: latest 

Or with:

- name: install the package, force reinstall to the latest version   pip:      name: <your package name>     state: forcereinstall 
like image 153
techraf Avatar answered Sep 20 '22 17:09

techraf


Eventually found the answer here: https://groups.google.com/forum/#!topic/ansible-project/a19JEpdXzck

this is the syntax:

- name: install the package, force upgrade   pip:      name: <your package name>     extra_args: --upgrade 
like image 29
FuzzyAmi Avatar answered Sep 21 '22 17:09

FuzzyAmi