Docker python client support for Window 10

Viewed 3468

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?

2 Answers

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).

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 :(

Related