question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

AttributeError: 'module' object has no attribute 'DockerClient'

See original GitHub issue

Followed example on https://docker-py.readthedocs.io/en/stable/client.html:

>>> import docker
>>> client = docker.DockerClient(base_url='unix://var/run/docker.sock')

Received the following error:

AttributeError: 'module' object has no attribute 'DockerClient'

Additional info:

# pip list | grep docker
docker-py                        1.10.6

# python -V
Python 2.7.5

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5

github_iconTop GitHub Comments

4reactions
shin-commented, Apr 30, 2018

You’re using the wrong package. Uninstall docker-py and install docker instead.

1reaction
greenpaucommented, Apr 30, 2018

You probably have some path conflicts.

@shin- , I had to manually delete /usr/lib/python2.7/site-packages/docker and install again.

Read more comments on GitHub >

github_iconTop Results From Across the Web

python cannot import module - docker - Stack Overflow
import docker c = docker.Client() c.info() ... Client() AttributeError: 'module' object has no attribute 'Client'.
Read more >
AttributeError: 'module' object has no attribute 'APIError'
I'm running ansible from an ubuntu 13.10 machine with ansible 1.6.6 on it. I'm using it to build two docker images for nginx...
Read more >
Bug #1693425 “Cannot import docker client” : Bugs : Zun
DockerClient. 2017-05-25 14:01:31.608 CRITICAL zun [-] AttributeError: 'module' object has no attribute 'Client' Following error threw when ...
Read more >
SALT AttributeError: 'module' object has no attribute 'dockermod'
The error is due to AttributeError: 'module' object that has no attribute 'dockermod'. This is due to a known and fixed regression in...
Read more >
docker python sdk not running - Reddit
File "/Users/Akushwaha/Downloads/docker.py", line 5, in <module>. client = docker.from_env(). AttributeError: 'module' object has no ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found