3

I installed docker python client on Window 10 machine. My machine has python-3.7 version running & it has pypiwin32 version 223. I am able to import docker client as well but when I am trying to use one of the class from_env() to create object then it is throwing error:

import docker
docker.from_env() 

Traceback (most recent call last):
File "C:\Users\abhishek.jain\AppData\Local\Programs\Python\Python37\lib\site-packages\docker\client.py", line 74, in init self._custom_adapter = NpipeAdapter( NameError: name 'NpipeAdapter' is not defined

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "", line 1, in docker.from_env() File "C:\Users\abhishek.jain\AppData\Local\Programs\Python\Python37\lib\site-packages\docker\client.py", line 27, in from_env return Client.from_env(**kwargs) File "C:\Users\abhishek.jain\AppData\Local\Programs\Python\Python37\lib\site-packages\docker\client.py", line 112, in from_env return cls(version=version, **kwargs_from_env(**kwargs)) File "C:\Users\abhishek.jain\AppData\Local\Programs\Python\Python37\lib\site-packages\docker\client.py", line 79, in init 'Install pypiwin32 package to enable npipe:// support' docker.errors.DockerException: Install pypiwin32 package to enable npipe:// support

Could you please confirm whether docker python client does have support ability for Window 10?

U13-Forward
  • 69,221
  • 14
  • 89
  • 114
Abhishek Jain
  • 3,815
  • 2
  • 26
  • 26
  • Have you tried the suggestion provided by the error: "Install pypiwin32 package to enable npipe:// support" – Gerben Jongerius Jan 11 '19 at 14:29
  • it is already installed version 223 of pypiwin32... That version seems to be the correct version for Python3.7 If I understood the documentation correctly... C:\Users\abhishek.jain>pip install pypiwin32 Requirement already satisfied: pypiwin32 in c:\users\abhishek.jain\appdata\local\programs\python\python37\lib\site-packages (223) Requirement already satisfied: pywin32>=223 in c:\users\abhishek.jain\appdata\local\programs\python\python37\lib\site-packages\pywin32-223-py3.7-win-amd64.egg (from pypiwin32) (223) C:\Users\abhishek.jain> – Abhishek Jain Jan 12 '19 at 04:56
  • which exact (kernel) version of windows and docker are you running? – Falco Alexander Jan 14 '19 at 11:12
  • Docker version 18.09.0, build 4d60db4 OS Name - Microsoft Windows 10 Pro version - 10.0.17134 build 17134 Please let me know if any additional information you need for further investigation on this issue – Abhishek Jain Jan 14 '19 at 13:41
  • so you run Win10 1803 Update? I am quite sure that named pipe communication was introduced with server 2019 and win 1809, but not earlier. Can you check that with a newer Windows? be also aware that you have to specify the pipes in the docker run command afaik. – Falco Alexander Jan 14 '19 at 17:18
  • yes it Window 1803 OS build 17134.523 – Abhishek Jain Jan 15 '19 at 12:06
  • [pywin32 is the new pypiwin32](https://stackoverflow.com/questions/55918311/what-is-the-difference-between-pywin32-and-pypiwin32) – Cees Timmerman May 27 '21 at 12:14

2 Answers2

1

So I got the same issue and I figured out that this was an issue due to pypiwin32==224 if you are using python 3.6 or 3.7. The workaround, if you are using a lower python version, would be to install pypiwin32==220. this workaround will not work for versions 3.6 and 3.7 as this version is not supported. I would suggest working with a version of python that supports pypiwin32==220. I encountered this issue when I tried to run aws-sam local and in the end I uninstalled aws-sam-cli using pip and I installed it with msi :(

Amaioka
  • 61
  • 3
0

Containers named pipe communication with Docker API was introduced with Server 2019 and Win 1809.

You can you check that with a an updated 1809 Windows 10. be also aware that you have to specify the pipes in the docker run command like example show it the linked blog post.

If you cannot update you computer, you can do it with preinstalled Azure Win10 VMs. You'll find it in the Azure Marketplace. Not 100% sure if you need a MSDN Subscription for this.

By the way, with the latest Docker Desktop 18.09.1 process isolation is working so you wouldn't even need (nested) virtualisation(Azure) or hyper-V (local).

Falco Alexander
  • 3,092
  • 2
  • 20
  • 39