Skip to content

AttributeError: 'module' object has no attribute 'from_env' #1370

Closed

Description

Currently on OS X El Capitan 10.11.6

$ pip freeze | grep docker && python --version && docker version
docker==2.0.0
docker-compose==1.7.0
docker-py==1.8.1
docker-pycreds==0.2.1
dockerpty==0.4.1
Python 2.7.11
Client:
 Version:      1.12.5
 API version:  1.24
 Go version:   go1.6.4
 Git commit:   7392c3b
 Built:        Fri Dec 16 06:14:34 2016
 OS/Arch:      darwin/amd64

Server:
 Version:      1.12.5
 API version:  1.24
 Go version:   go1.6.4
 Git commit:   7392c3b
 Built:        Fri Dec 16 06:14:34 2016
 OS/Arch:      linux/amd64

Attempting to run test file with contents of:

import docker
client = docker.from_env()

Following error:

$ python docker.py
Traceback (most recent call last):
  File "docker.py", line 1, in <module>
    import docker
  File "/Users/docker.py", line 3, in <module>
    client = docker.from_env()
AttributeError: 'module' object has no attribute 'from_env'

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions