pip docker install

49 views
Skip to first unread message

Alfredo De Luca

unread,
Oct 2, 2019, 4:36:56 AM10/2/19
to ansible...@googlegroups.com
Hi all.
I have the following...

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

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

When I run the playbook the first time it fails with
<SNIP>
FAILED! => {"changed": false, "msg": "Failed to import the required Python library (Docker SDK for Python: docker (Python >= 2.7) or docker-py (Python 2.6)) on myhost 's Python /usr/bin/python3. Please read module documentation and install in the appropriate location, for example via `pip install docker` or `pip install docker-py` (Python 2.6). The error was: No module named 'docker'"}
<SNIP>

But if ti runs the second time no issue at all.
Any idea why? I thought it was cause it can't find the path for PIP ..... but not sure. 
Cheers

--
Alfredo

Ravi Ranjan

unread,
Oct 2, 2019, 6:00:06 AM10/2/19
to ansible...@googlegroups.com
Hi Luca ,

I have observed the same for our GCP instances where i am running docker on VM . Then, i had to uninstall via "pip uninstall docker" and then re-install it - "pip install docker" . Issues get resolved . 

Ravi Ranjan

--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CAAWpFTFQcY0wCk64yQ30g5gG-0njYy12NDi5OeC60dsr%2BGHYjg%40mail.gmail.com.

Alfredo De Luca

unread,
Oct 2, 2019, 9:50:46 AM10/2/19
to ansible...@googlegroups.com
Hi Ravi. I ve done that but didn't work. 

It seems to have problem finding the package pip rather than the docker library itself.







--
Alfredo

Ravi Ranjan

unread,
Oct 2, 2019, 11:31:31 AM10/2/19
to ansible...@googlegroups.com
After uninstall via "pip uninstall docker" and then use "pip install docker --upgrade" , if that also didnt work - u need to un-install docker-compose as well "pip uninstall docker-compose" , it should work then

This issue happened to me last week in production  



Alfredo De Luca

unread,
Oct 2, 2019, 11:37:28 AM10/2/19
to ansible...@googlegroups.com
ok thanks I will give it a try
cheers



--
Alfredo

Ravi Ranjan

unread,
Oct 2, 2019, 11:48:38 AM10/2/19
to ansible...@googlegroups.com
These steps needs to be done on the remote machine 
1) pip uninstall docker
2) pip list | grep docker
3) pip uninstall docker-compose 
4) pip install docker --upgrade 

This should work  

P. Varsha

unread,
Oct 3, 2019, 1:52:26 AM10/3/19
to ansible...@googlegroups.com
hello,

check once from command prompt pip install docker under the python scripts folder it will work.

thanks,
varsha

I’m protected online with Avast Free Antivirus. Get it here — it’s free forever.


I’m protected online with Avast Free Antivirus. Get it here — it’s free forever.

Alfredo De Luca

unread,
Oct 3, 2019, 1:43:06 PM10/3/19
to ansible...@googlegroups.com
still doesn't work. everything I do the first time doesn't work and the second time it does....

very very weird...




--
Alfredo

P. Varsha

unread,
Oct 4, 2019, 1:10:36 AM10/4/19
to ansible...@googlegroups.com
can you share the screenshot if is it possible?.i tell u in better way

Stefan Hornburg (Racke)

unread,
Oct 4, 2019, 3:30:55 AM10/4/19
to ansible...@googlegroups.com
On 10/3/19 7:42 PM, Alfredo De Luca wrote:
> still doesn't work. everything I do the first time doesn't work and the second time it does....
>
> very very weird...

Can you provide OS and release information about the target?

Regards
Racke

>
>
> On Thu, Oct 3, 2019 at 7:52 AM P. Varsha <p.vars...@gmail.com <mailto:p.vars...@gmail.com>> wrote:
>
> hello,
>
> check once from command prompt */pip install docker/* under the python scripts folder it will work.
>
> thanks,
> varsha
>
> <https://www.avast.com/en-in/recommend?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail&utm_term=default3&tag=85053955-6b69-4d04-b801-1af3fb015be0>
> I’m protected online with Avast Free Antivirus. Get it here — it’s free forever.
> <https://www.avast.com/en-in/recommend?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail&utm_term=default3&tag=85053955-6b69-4d04-b801-1af3fb015be0>
>
>
> <#m_7467768759848419475_DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
>
> On Wed, Oct 2, 2019 at 9:18 PM Ravi Ranjan <ravi.ra...@gmail.com <mailto:ravi.ra...@gmail.com>> wrote:
>
> These steps needs to be done on the remote machine 
> 1) pip uninstall docker
> 2) pip list | grep docker
> 3) pip uninstall docker-compose 
> 4) pip install docker --upgrade 
>
> This should work  
>
> On Wed, Oct 2, 2019 at 9:07 PM Alfredo De Luca <alfredo...@gmail.com <mailto:alfredo...@gmail.com>> wrote:
>
> ok thanks I will give it a try
> cheers
>
> *FAILED! => {"changed": false, "msg": "Failed to import the required Python library (Docker
> SDK for Python: docker (Python >= 2.7) or docker-py (Python 2.6)) on myhost 's Python
> /usr/bin/python3. Please read module documentation and install in the appropriate location,
> for example via `pip install docker` or `pip install docker-py` (Python 2.6). The error was:
> No module named 'docker'"}
> *
> <SNIP>
>
> But if ti runs the second time no issue at all.
> Any idea why? I thought it was cause it can't find the path for PIP ..... but not sure. 
> 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>.
> <https://groups.google.com/d/msgid/ansible-project/CAAWpFTFQcY0wCk64yQ30g5gG-0njYy12NDi5OeC60dsr%2BGHYjg%40mail.gmail.com?utm_medium=email&utm_source=footer>.
>
> --
> 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/CAGfYbJzYXPTS3dNdVtP45Bwa5rDC5%2B4Wb7tM30i2wjZsv6c-4A%40mail.gmail.com
> <https://groups.google.com/d/msgid/ansible-project/CAGfYbJzYXPTS3dNdVtP45Bwa5rDC5%2B4Wb7tM30i2wjZsv6c-4A%40mail.gmail.com?utm_medium=email&utm_source=footer>.
>
>
>
> --
> /*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/CAAWpFTFxfkRb%2B-nz8_6FM38j%2B4-emYEQMmWg_s6M-epUwXgG%3Dw%40mail.gmail.com
> <https://groups.google.com/d/msgid/ansible-project/CAAWpFTFxfkRb%2B-nz8_6FM38j%2B4-emYEQMmWg_s6M-epUwXgG%3Dw%40mail.gmail.com?utm_medium=email&utm_source=footer>.
>
> --
> 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/CAGfYbJxqw%2BsyGRpKGMAoSSH88h%3DHwuFA2eq3QrRVJe%2BnpSMkfw%40mail.gmail.com
> <https://groups.google.com/d/msgid/ansible-project/CAGfYbJxqw%2BsyGRpKGMAoSSH88h%3DHwuFA2eq3QrRVJe%2BnpSMkfw%40mail.gmail.com?utm_medium=email&utm_source=footer>.
>
>
>
> --
> /*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/CAAWpFTE_1dt2Fqrty98_O%3Dizshde2LGQ_O9dyC%2B7G3yF_ZgMNg%40mail.gmail.com
> <https://groups.google.com/d/msgid/ansible-project/CAAWpFTE_1dt2Fqrty98_O%3Dizshde2LGQ_O9dyC%2B7G3yF_ZgMNg%40mail.gmail.com?utm_medium=email&utm_source=footer>.
>
> --
> 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/CAGfYbJxJg4aJmx_uCE7dfNTpws-h-AMOzWDsBgxwDk5jJzkgCg%40mail.gmail.com
> <https://groups.google.com/d/msgid/ansible-project/CAGfYbJxJg4aJmx_uCE7dfNTpws-h-AMOzWDsBgxwDk5jJzkgCg%40mail.gmail.com?utm_medium=email&utm_source=footer>.
>
>
> <https://www.avast.com/en-in/recommend?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail&utm_term=default3&tag=85053955-6b69-4d04-b801-1af3fb015be0>
> I’m protected online with Avast Free Antivirus. Get it here — it’s free forever.
> <https://www.avast.com/en-in/recommend?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail&utm_term=default3&tag=85053955-6b69-4d04-b801-1af3fb015be0>
>
>
> <#m_7467768759848419475_DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
>
> --
> 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/CAA3T03L6%2BOC1sRMLNTbRy2nw1eu0wwZv9uT9DdZ%3DsYkY6NNkag%40mail.gmail.com
> <https://groups.google.com/d/msgid/ansible-project/CAA3T03L6%2BOC1sRMLNTbRy2nw1eu0wwZv9uT9DdZ%3DsYkY6NNkag%40mail.gmail.com?utm_medium=email&utm_source=footer>.
>
>
>
> --
> /*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/CAAWpFTGcFPy542mve9mty-0JjTBbz1PdQs2XVKzLWNKEEMk6cQ%40mail.gmail.com
> <https://groups.google.com/d/msgid/ansible-project/CAAWpFTGcFPy542mve9mty-0JjTBbz1PdQs2XVKzLWNKEEMk6cQ%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,
Oct 4, 2019, 5:56:49 AM10/4/19
to ansible...@googlegroups.com
Hi Stefan. 
Here is my vagrant file 
(1..3).each do |i|
  config.vm.define "iri-0#{i}" do |node|
    node.vm.box = "ubuntu/bionic64"
    node.vm.box_version = "20190918.0.0"
    node.vm.network "private_network", ip: "#{SUBNET}.1#{i}"
    node.vm.hostname = "imi-0#{i}"
    node.vm.provider :virtualbox do |v|
      v.cpus = 3
      v.memory = 3072
    end
  end
end

So basically is Ubuntu Bionic Vm create with Virtualbox

Alfredo


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/d931846a-d754-5643-c1a6-f526b049eddc%40linuxia.de.


--
Alfredo

Reply all
Reply to author
Forward
0 new messages