Docker-py: client.containers is a function object?

Created on 11 Aug 2017  路  1Comment  路  Source: docker/docker-py

Simply running the example code from the main page:
import docker
client = docker.from_env()
client.containers.run("ubuntu:latest", "echo hello world")

AttributeError: 'function' object has no attribute 'run'

it imports fine, I get a , but then I slam into the above error.

kinquestion

Most helpful comment

You're using 1.x, the example is for 2.x
pip uninstall docker-py && pip install -U docker

>All comments

You're using 1.x, the example is for 2.x
pip uninstall docker-py && pip install -U docker

Was this page helpful?
0 / 5 - 0 ratings