Closed
Description
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 "", line 1, in
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
Activity
shin- commentedon Feb 20, 2018
That's quite odd -
config_dict
is a valid argument forload_config
in 3.x, so there's no reason that error should happen.Is it possible you have different versions of the package interfering with one another, maybe inside / outside a virtualenv?
stephan227 commentedon Feb 23, 2018
I am running into the same problem. I had to downgrade to docker-py2.7. Currently using docker Version 17.12.0-ce-mac49
I fixed it by removing python and python packages and re-installing python. Installing the legacy docker-py package appears to cause issues when installed along the latest docker package.
shin- commentedon Feb 25, 2018
stephan227 commentedon Feb 26, 2018
Yes, different versions caused an issue on my machine. I had to remove python and re-install it.
ghost commentedon Mar 20, 2018
I am getting the same error in a pipenv virtualenv
under
Python 3.6.4
,Traceback
Here are my Pipfile and Pipfile.lock
dockapt.zip
UPDATE:
Downgrading to
docker==2.7.0
usingpipenv install "docker<3"
solves the issueshin- commentedon Mar 20, 2018
Fixed in 3.1.3
#1968
w7089 commentedon May 2, 2018
Have the same issue still with docker 3.3.0
shin- commentedon May 2, 2018
You probably have old artifacts messing up your imports. Remove all
docker
anddocker-py
packages (inside/outside virtualenv) then reinstall.hushenbeg commentedon May 3, 2018
@shin- i am using python 3.6 version and trying to import the docker
and i got the
TypeError: load_config() got an unexpected keyword argument 'config_dict'
please tell me whats happing exactly inside the code
w7089 commentedon May 9, 2018
@shin- removed
docker
anddocker-py
packages, reinstalleddocker
anddocker-py
packages and getting the error still:python version is
On other system, your suggestion helped:
3 remaining items
geoffreywiseman commentedon Jun 20, 2018
I'm getting the sense that if I'm trying to use the docker module with Python2, I need to install "docker<3", but that's not covered by the module documentation anywhere that I can see? The README suggests to just install 'docker', and the pypi docs suggest 'docker' is compatible with Python2, but if I do that, I end up at this error.
kleptog commentedon 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:
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:
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).
pwaller commentedon Nov 14, 2018
I hit this running docker-compose after an upgrade of docker-compose, and filed docker/compose#6339 there. Seems worth preventing that failure mode.
Adds dependency to docker python module
Adds dependency to docker python module
Adds dependency to docker python module
imsheth commentedon Mar 26, 2021
Issue with airflow 2.1.0 was that it had some compatibility issues with python 3.8 even though Airflow suggests that it works fine with python 3.8, I switched to fresh python 3.6 installation and everything worked fine.