Pip install docker

295 views
Skip to first unread message

Alfredo De Luca

unread,
Sep 21, 2019, 7:11:28 AM9/21/19
to ansible...@googlegroups.com
Hi all. 
I installed python pip with ansible then, in the same playbook, I use pip to install docker-py libs.... but it keep saying 
"Unable to find any of pip3 to use.  pip needs to be installed."
Then If I run the same playbook or if I ssh the box then run manually pip install docker it runs ok.

Any idea why it fails the fir time? 

Ansible version is 2.8.5 


Cheers


--
Alfredo

Stefan Hornburg (Racke)

unread,
Sep 21, 2019, 7:16:04 AM9/21/19
to ansible...@googlegroups.com
On 9/21/19 1:11 PM, Alfredo De Luca wrote:
> Hi all. 
> I installed python pip with ansible then, in the same playbook, I use pip to install docker-py libs.... but it keep saying 
> *"Unable to find any of pip3 to use.  pip needs to be installed."
> *
> Then If I run the same playbook or if I ssh the box then run manually pip install docker it runs ok.
>
> Any idea why it fails the fir time? 
>
> Ansible version is 2.8.5

How does your playbook look like, especially the pip install tasks?

Regards
Racke

>
>
> Cheers
>
>
> --
> /*Alfredo*/
>
> --
> You received this message because you are subscribed to the Google Groups "Ansible Project" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to
> ansible-proje...@googlegroups.com <mailto:ansible-proje...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/CAAWpFTGGfEsXikyoeSepdTMmT1W9PdZVo9_CYe32t5pPUJdnng%40mail.gmail.com
> <https://groups.google.com/d/msgid/ansible-project/CAAWpFTGGfEsXikyoeSepdTMmT1W9PdZVo9_CYe32t5pPUJdnng%40mail.gmail.com?utm_medium=email&utm_source=footer>.


--
Ecommerce and Linux consulting + Perl and web application programming.
Debian and Sympa administration. Provisioning with Ansible.

signature.asc

Alfredo De Luca

unread,
Sep 21, 2019, 7:19:14 AM9/21/19
to ansible...@googlegroups.com
Thanks 


- name: Install docker libs with pip
  pip:
    name: docker
    state: present


To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/55eeb964-a57d-18fa-d135-53864d3c251c%40linuxia.de.


--
Alfredo

Stefan Hornburg (Racke)

unread,
Sep 21, 2019, 7:22:45 AM9/21/19
to ansible...@googlegroups.com
On 9/21/19 1:18 PM, Alfredo De Luca wrote:
> Thanks 
>
>
> - name: Install docker libs with pip
>   pip:
>     name: docker
>     state: present
>

OK, but you also installed pip with Ansible before? Check if Ansible keeps the pip location in its facts,
that would explain your problem with the first install.

Regards
Racke

>
> On Sat, Sep 21, 2019 at 1:15 PM Stefan Hornburg (Racke) <ra...@linuxia.de <mailto:ra...@linuxia.de>> wrote:
>
> On 9/21/19 1:11 PM, Alfredo De Luca wrote:
> > Hi all. 
> > I installed python pip with ansible then, in the same playbook, I use pip to install docker-py libs.... but it
> keep saying 
> > *"Unable to find any of pip3 to use.  pip needs to be installed."
> > *
> > Then If I run the same playbook or if I ssh the box then run manually pip install docker it runs ok.
> >
> > Any idea why it fails the fir time? 
> >
> > Ansible version is 2.8.5
>
> How does your playbook look like, especially the pip install tasks?
>
> Regards
>           Racke
>
> >
> >
> > Cheers
> >
> >
> > --
> > /*Alfredo*/
> >
> > --
> > You received this message because you are subscribed to the Google Groups "Ansible Project" group.
> > To unsubscribe from this group and stop receiving emails from it, send an email to
> > ansible-proje...@googlegroups.com <mailto:ansible-project%2Bunsu...@googlegroups.com>
> <mailto:ansible-proje...@googlegroups.com <mailto:ansible-project%2Bunsu...@googlegroups.com>>.
> > To view this discussion on the web visit
> > https://groups.google.com/d/msgid/ansible-project/CAAWpFTGGfEsXikyoeSepdTMmT1W9PdZVo9_CYe32t5pPUJdnng%40mail.gmail.com
> >
> <https://groups.google.com/d/msgid/ansible-project/CAAWpFTGGfEsXikyoeSepdTMmT1W9PdZVo9_CYe32t5pPUJdnng%40mail.gmail.com?utm_medium=email&utm_source=footer>.
>
>
> --
> Ecommerce and Linux consulting + Perl and web application programming.
> Debian and Sympa administration. Provisioning with Ansible.
>
> --
> You received this message because you are subscribed to the Google Groups "Ansible Project" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to
> ansible-proje...@googlegroups.com <mailto:ansible-project%2Bunsu...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/55eeb964-a57d-18fa-d135-53864d3c251c%40linuxia.de.
>
>
>
> --
> /*Alfredo*/
>
> --
> You received this message because you are subscribed to the Google Groups "Ansible Project" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to
> ansible-proje...@googlegroups.com <mailto:ansible-proje...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/CAAWpFTEqi4xFZvXt6UvnG_1wD4HjCKcvj1-p-fC1XqmdBC2E_A%40mail.gmail.com
> <https://groups.google.com/d/msgid/ansible-project/CAAWpFTEqi4xFZvXt6UvnG_1wD4HjCKcvj1-p-fC1XqmdBC2E_A%40mail.gmail.com?utm_medium=email&utm_source=footer>.
signature.asc

Alfredo De Luca

unread,
Sep 21, 2019, 7:26:36 AM9/21/19
to ansible...@googlegroups.com
thanks Stefan.....here is how I install pip

- name: Install pip
  package:
    name: python-pip
    update_cache: true
    state: present


To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/09deceba-6d73-4166-6f52-051f05f9008c%40linuxia.de.


--
Alfredo

Vladimir Botka

unread,
Sep 21, 2019, 7:38:42 AM9/21/19
to Alfredo De Luca, ansible...@googlegroups.com
On Sat, 21 Sep 2019 13:18:42 +0200
Alfredo De Luca <alfredo...@gmail.com> wrote:

> - name: Install docker libs with pip
> pip:
> name: docker
> state: present

> > > *"Unable to find any of pip3 to use. pip needs to be installed."

Find out which pip you'd like to use. For example

$ which pip3
/usr/bin/pip3

Use it in the module. For example

- pip:
name: docker
state: present
executable: /usr/bin/pip3

See details https://docs.ansible.com/ansible/latest/modules/pip_module.html

Cheers,

-vlado

Alfredo De Luca

unread,
Sep 21, 2019, 6:10:42 PM9/21/19
to Vladimir Botka, ansible...@googlegroups.com
thanks guys. it worked.
cheers

--
Alfredo

Reply all
Reply to author
Forward
0 new messages