Docker-py: not able to connect to docker on Windows

Created on 29 Dec 2016  路  5Comments  路  Source: docker/docker-py

client = docker.from_env()
client.images.list()

or any other function calls
gives this error:

 File "C:\Python27\lib\site-packages\docker\models\images.py", line 209, in list
    resp = self.client.api.images(name=name, all=all, filters=filters)
  File "C:\Python27\lib\site-packages\docker\api\image.py", line 93, in images
    res = self._result(self._get(self._url("/images/json"), params=params),
  File "C:\Python27\lib\site-packages\docker\utils\decorators.py", line 47, in inner
    return f(self, *args, **kwargs)
  File "C:\Python27\lib\site-packages\docker\api\client.py", line 175, in _get
    return self.get(url, **self._set_request_timeout(kwargs))
  File "C:\Python27\lib\site-packages\requests\sessions.py", line 501, in get
    return self.request('GET', url, **kwargs)
  File "C:\Python27\lib\site-packages\requests\sessions.py", line 488, in request
    resp = self.send(prep, **send_kwargs)
  File "C:\Python27\lib\site-packages\requests\sessions.py", line 609, in send
    r = adapter.send(request, **kwargs)
  File "C:\Python27\lib\site-packages\requests\adapters.py", line 423, in send
    timeout=timeout
  File "C:\Python27\lib\site-packages\requests\packages\urllib3\connectionpool.py", line 594, in urlopen
    chunked=chunked)
  File "C:\Python27\lib\site-packages\requests\packages\urllib3\connectionpool.py", line 361, in _make_request
    conn.request(method, url, **httplib_request_kw)
  File "C:\Python27\lib\httplib.py", line 1057, in request
    self._send_request(method, url, body, headers)
  File "C:\Python27\lib\httplib.py", line 1097, in _send_request
    self.endheaders(body)
  File "C:\Python27\lib\httplib.py", line 1053, in endheaders
    self._send_output(message_body)
  File "C:\Python27\lib\httplib.py", line 897, in _send_output
    self.send(msg)
  File "C:\Python27\lib\httplib.py", line 859, in send
    self.connect()
  File "C:\Python27\lib\site-packages\docker\transport\npipeconn.py", line 31, in connect
    sock.connect(self.npipe_path)
  File "C:\Python27\lib\site-packages\docker\transport\npipesocket.py", line 22, in wrapped
    return f(self, *args, **kwargs)
  File "C:\Python27\lib\site-packages\docker\transport\npipesocket.py", line 50, in connect
    win32pipe.WaitNamedPipe(address, self._timeout)
pywintypes.error: (2, 'WaitNamedPipe', 'The system cannot find the file specified.')'

pip freeze

backports.ssl-match-hostname==3.5.0.1
docker==2.0.0
docker-pycreds==0.2.1
enum34==1.1.6
futures==3.0.5
grpcio==1.0.4
grpcio-tools==1.0.4
ipaddress==1.0.17
protobuf==3.1.0.post1
pymongo==3.4.0
pypiwin32==219
pyserial==3.2.1
requests==2.12.4
six==1.10.0
websocket-client==0.40.0


Docker version
1.12.3, build 6b644ec

grouwindows

Most helpful comment

I've got the same issue, docker installed with an installer from their website

All 5 comments

How did you install Docker?

I've got the same issue, docker installed with an installer from their website

Same problem here.
Configuration:

  • Windows 10
  • Anaconda 2-4.4.0
  • Docker toolbox install, version 17.04.0-ce, build 4845c56

problem persists.
installed with Docker Toolbox

VMs created using Toolbox don't expose a named pipe and should be connected to using their TCP address. Make sure you set the appropriate environment variables as indicated in the docker-machine env command output.

Was this page helpful?
0 / 5 - 0 ratings