pkg_resources.DistributionNotFound: The 'backports.ssl-match-hostname>=3.5;

docker

[code lang=text] [root@astel]# docker-compose down Traceback (most recent call last): File "/bin/docker-compose", line 5, in <module> from pkg_resources import load_entry_point File "/usr/lib/python2.7/site-packages/pkg_resources/init.py", line 2953, in <module> @call_aside File "/usr/lib/python2.7/site-packages/pkg_resources/init.py", line 2939, in call_aside f(*args, **kwargs) File "/usr/lib/python2.7/site-packages/pkg_resources/init.py", line 2966, in initialize_master_working_set working_set = WorkingSet.build_master() File "/usr/lib/python2.7/site-packages/pkg_resources/init.py", line 637, in build_master return cls.build_from_requirements(requires) File "/usr/lib/python2.7/site-packages/pkg_resources/init.py", line 650, in _build_from_requirements dists = ws.resolve(reqs, Environment()) File "/usr/lib/python2.7/site-packages/pkg_resources/init.py", line 829, in resolve raise DistributionNotFound(req, requirers) pkg_resources.DistributionNotFound: The 'backports.ssl-match-hostname>=3.5; python_version < "3.5"' distribution was not found and is required by docker-py [/code]

解決方法

[code lang=text] [root@astel]# pip install --upgrade backports.ssl_match_hostname Collecting backports.ssl_match_hostname Downloading backports.ssl_match_hostname-3.5.0.1.tar.gz Installing collected packages: backports.ssl-match-hostname Found existing installation: backports.ssl-match-hostname 3.4.0.2 Uninstalling backports.ssl-match-hostname-3.4.0.2: Successfully uninstalled backports.ssl-match-hostname-3.4.0.2 Running setup.py install for backports.ssl-match-hostname ... done Successfully installed backports.ssl-match-hostname-3.5.0.1 [root@astel]# docker-compose down Removing wp ... done Removing db ... done [/code]