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

前端 未结 8 649
失恋的感觉
失恋的感觉 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条回答
  •  日久生厌
    2021-02-04 04:17

    On Ubuntu/Debian, there is a bug related to package upgrade (bug #893520) at the moment, where the __init__.py file is not generated.

    Check if the following file exists: /usr/lib/python2.7/dist-packages/backports/__init__.py

    If it does not exist and the package python-backports.ssl-match-hostname is installed, then run the following command to generate the missing file:

    sudo pycompile -p python-backports.ssl-match-hostname
    

提交回复
热议问题