Python 来自docker py客户端的意外行为

Python 来自docker py客户端的意外行为,python,dockerpy,Python,Dockerpy,我试图运行docker py包的入门文档()中的一些基本代码,但在Python 2.7.6和Python 3.4.3中都遇到了问题: >>> client = docker.from_env() >>> client.images.list() Traceback (most recent call last): File "<stdin>", line 1, in <module> AttributeError: 'function'

我试图运行docker py包的入门文档()中的一些基本代码,但在Python 2.7.6和Python 3.4.3中都遇到了问题:

>>> client = docker.from_env()
>>> client.images.list()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: 'function' object has no attribute 'list'

根据文件,这似乎是意外的行为。为什么client.images是一个列表,而不是文档中提到的images类的实例(如图所示:)?我一定错过了一些简单的东西。有什么想法吗?

想出来了。我让pip安装了docker py,但是当前版本的包在pypi上被简单地称为“docker”

client.images()
[{u'Created': 1476822682, u'Labels': None, u'VirtualSize': 4802964, u'ParentId': u'', u'RepoTags': [u'alpine:3.4'], u'RepoDigests': [u'alpine@sha256:1354db23ff5478120c980eca1611a51c9f2b88b61f24283ee8200bf9a54f2e5c'], u'Id': u'sha256:baa5d63471ead618ff91ddfacf1e2c81bf0612bfeb1daf00eb0843a41fbfade3', u'Size': 4802964}]