When doing a pip install with a fresh venv it installs websocket-client 1.0.0 due to the websocket-client>=0.32.0 requirement.
requirements.txt
docker==5.0.0
test.py
import docker
Running python test.py gives the following error
Traceback (most recent call last):
File "test_failing_docker_sdk.py", line 1, in <module>
import docker
File "/projects/myproj/src/main/python/env/lib/python3.6/site-packages/docker/__init__.py", line 2, in <module>
from .api import APIClient
File "/projects/myproj/src/main/python/env/lib/python3.6/site-packages/docker/api/__init__.py", line 2, in <module>
from .client import APIClient
File "/projects/myproj/src/main/python/env/lib/python3.6/site-packages/docker/api/client.py", line 10, in <module>
from .. import auth
File "/projects/myproj/src/main/python/env/lib/python3.6/site-packages/docker/auth.py", line 5, in <module>
import six
ModuleNotFoundError: No module named 'six'
logs when installing with pip
Collecting websocket-client>=0.32.0 (from docker==5.0.0->-r requirements.txt (line 2))
Using cached https://files.pythonhosted.org/packages/ba/d1/501076b54481412df1bc4cdd1fe479f66e17857c63ec5981bedcdc2ca793/websocket_client-1.0.0-py2.py3-none-any.whl
$ pip freeze && python --version && docker version
certifi==2020.12.5
chardet==4.0.0
docker==5.0.0
idna==2.10
requests==2.25.1
urllib3==1.26.4
websocket-client==1.0.0
Python 3.6.8
Client: Docker Engine - Community
Version: 19.03.8
API version: 1.40
Go version: go1.12.17
Git commit: afacb8b
Built: Wed Mar 11 01:21:11 2020
OS/Arch: darwin/amd64
Experimental: false
Server: Docker Engine - Community
Engine:
Version: 19.03.8
API version: 1.40 (minimum version 1.12)
Go version: go1.12.17
Git commit: afacb8b
Built: Wed Mar 11 01:29:16 2020
OS/Arch: linux/amd64
Experimental: false
containerd:
Version: v1.2.13
GitCommit: 7ad184331fa3e55e52b890ea95e65ba581ae3429
runc:
Version: 1.0.0-rc10
GitCommit: dc9208a3303feef5b3839f4323d9beb36df0a9dd
docker-init:
Version: 0.18.0
GitCommit: fec3683
```
dependency tree using `pipdeptree` that shows docker required >=0.32.0
$ pipdeptree
docker==5.0.0
my current workaround is to limit the range of `websocket-client` in my requirements.txt
docker==5.0.0
websocket-client>=0.32.0,<1
```
This isn't really related to the websocket-client changes, but due to docker not properly tracking its dependencies and relying on another package to pull them in. The change to setup.py should be to explicitly include the six dependency.
Ran into a similar problem yesterday when trying to install on a CentOS7 box where I'm forced to use python 2.7.5, therefore restricted to version 4.4.4 of the docker library.
Only work-around I've found is to explicitly install the websocket-client dependency with a <1 argument prior to installing docker.
Is there any chance of getting a 4.4.5 release of the docker library to support those of stuck in the last decade?
I know it's a long shot, but it would be incredibly helpful, there are lots of places e.g. the ansible docker community collection where we're told to explicitly use version 4.4.4 of the docker library on systems running python 2.7 and currently all of that documentation is incorrect due to this dependency issue.
Most helpful comment
Ran into a similar problem yesterday when trying to install on a CentOS7 box where I'm forced to use
python 2.7.5, therefore restricted to version4.4.4of the docker library.Only work-around I've found is to explicitly install the
websocket-clientdependency with a<1argument prior to installingdocker.Is there any chance of getting a
4.4.5release of the docker library to support those of stuck in the last decade?I know it's a long shot, but it would be incredibly helpful, there are lots of places e.g. the ansible docker community collection where we're told to explicitly use version 4.4.4 of the docker library on systems running python 2.7 and currently all of that documentation is incorrect due to this dependency issue.