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.

docker.from_env() causes TypeError: load_config() got an unexpected keyword argument 'config_dict'

See original GitHub issue

After upgrading docker to Server Version: 17.12.0-ce and docker-py to 3.0.1

Getting error:

Traceback (most recent call last): File “<stdin>”, line 1, in <module> File “/usr/lib/python2.7/site-packages/docker/client.py”, line 81, in from_env **kwargs_from_env(**kwargs)) File “/usr/lib/python2.7/site-packages/docker/client.py”, line 38, in init self.api = APIClient(*args, **kwargs) File “/usr/lib/python2.7/site-packages/docker/api/client.py”, line 110, in init config_dict=self._general_configs TypeError: load_config() got an unexpected keyword argument ‘config_dict’

When using simple call

import docker
c = docker.from_env()

Is it a known bug? What version of docker-py is compatible with docker17.12.0-ce ?

Regards

P.S. downgrading to docker-py2.7 solves the issue

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:3
  • Comments:16

github_iconTop GitHub Comments

25reactions
kleptogcommented, Jul 20, 2018

I’m getting this issue too. Not sure exactly why it’s triggering, but I do notice there are two load_config functions:

/usr/local/lib/python2.7/dist-packages/docker/auth/auth.py:def load_config(config_path=None):
/usr/local/lib/python2.7/dist-packages/docker/auth.py:def load_config(config_path=None, config_dict=None):

Looking at the names of the files and directories I wonder if there is an importing order difference that causes it for some people to import the wrong module?

Also, this is the output of pip freeze:

docker==3.4.1
docker-compose==1.22.0
docker-py==1.10.6

Apparently docker is the replacement for docker-py, but does not conflict with it, so they simply install over each other. To fix this you have to uninstall both of them, then install just the right one. (And hope other pypi modules don’t pull the old module).

7reactions
shin-commented, May 2, 2018

You probably have old artifacts messing up your imports. Remove all docker and docker-py packages (inside/outside virtualenv) then reinstall.

Read more comments on GitHub >

github_iconTop Results From Across the Web

using logging exception in python Code Example - Code Grepper
Get Python error information with debug output ... discord bot python add bio · TypeError: attrib() got an unexpected keyword argument 'convert' ...
Read more >
OpenStack: ChangeLog - Fossies
As a special service "Fossies" has tried to format the requested text file into HTML format (style: standard) with prefixed line numbers.
Read more >
Learning Web Development With Flask | PDF - Scribd
The official guide to developing web applications with python micro web development framework i.e. Flask. This book will guide you from the very...
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