docker-py: get_config_header error on mac
Thanks in advance for the help
client = docker.from_env()
client.containers.run("ubuntu", "echo hello world")
/usr/local/lib/python2.7/site-packages/docker/models/containers.pyc in run(self, image, command, stdout, stderr, remove, **kwargs)
653 detach=detach, **kwargs)
654 except ImageNotFound:
--> 655 self.client.images.pull(image)
656 container = self.create(image=image, command=command,
657 detach=detach, **kwargs)
/usr/local/lib/python2.7/site-packages/docker/models/images.pyc in pull(self, name, **kwargs)
254 >>> image = client.images.pull('busybox')
255 """
--> 256 self.client.api.pull(name, **kwargs)
257 return self.get(name)
258
/usr/local/lib/python2.7/site-packages/docker/api/image.pyc in pull(self, repository, tag, stream, insecure_registry, auth_config, decode)
331 if utils.compare_version('1.5', self._version) >= 0:
332 if auth_config is None:
--> 333 header = auth.get_config_header(self, registry)
334 if header:
335 headers['X-Registry-Auth'] = header
AttributeError: 'module' object has no attribute 'get_config_header'
What am I doing wrong?
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Comments: 16 (2 by maintainers)
Commits related to this issue
- Handle https://github.com/docker/docker-py/issues/1353 — committed to vmarkovtsev/bblfsh.client-python by vmarkovtsev 7 years ago
- Merge pull request #12 from vmarkovtsev/fix-macos Handle https://github.com/docker/docker-py/issues/1353 — committed to bblfsh/python-client by juanjux 7 years ago
- [DOC] Zun Troubleshooting Describing manual fix for 'module' object has no attribute 'get_config_header' https://github.com/docker/docker-py/issues/1353 https://review.openstack.org/#/c/475526/ — committed to janmattfeld/DockStack by janmattfeld 7 years ago
You may need to uninstall the
docker-py
package as it may be conflicting with the newdocker
package.Let me know if it helps.
So, I fixed this by removing the leftover files after an upgrade
I have upgraded from 1.6 to 2.4.2
Long story here
I got this error when I try to run a container for an image which does not exists.
here is the test_docker.py code
and here is the output
I done some debugging and i got
While checking the upstream code for release 2.4.2 https://github.com/docker/docker-py/tree/2.4.2-release/docker I saw that there is no auth package… only a module.
So, it looks like the trouble is from a bad upgrade.
Manual cleanup and all is good 😃
My versions
@IoTPlay docker-compose depends on docker, not on docker-py - so installing docker-py beforehand will ensure a broken install in all cases,
please skip docker-py
@shin- i can replicate the issue.
docker-py
was installed, pip install docker would use the wheel and not catch the error $ pip install docker-py docker will succeed, afterwards i getits only fixable by uninstalling both packages and reinstalling docker
in order to protect users i suggest to move the check from
setup.py
todocker/__init__.py
in modern timessetup.py
is not executed at all since pip uses wheels if possible and aggressively caches wheels locally as well