ImportError: No module named ssl_match_hostname when importing the docker SDK for Python

前端 未结 8 647
失恋的感觉
失恋的感觉 2021-02-04 03:49

In order to use the Docker SDK for Python, I\'m trying to import docker in a Python script, but it\'s resulting in an ImportError with the following tr

8条回答
  •  闹比i
    闹比i (楼主)
    2021-02-04 04:09

    The issue could be there because of different versions of Docker-compose and Docker. First compare the version and upgrade it to make it compatible.

    Secondly,you can uninstall the backport package (via pip).

    sudo pip uninstall backports.ssl-match-hostname
    

    and then install it again as a ubuntu package.

    sudo apt-get install python-backports.ssl-match-hostname
    

提交回复
热议问题