[Solved] docker-compose:No module named ssl_match_hostname; ImportError: No module named shutil_get_te…

 

Reason for error, ssl_match_hostname not found

The online solution is: pip install –upgrade backports.ssl_match_hostname
It doesn’t actually work, it prompts that the module is already installed in /usr/local/lib/python2.7/dist-packages

[email protected]~:#pip2 install –upgrade backports.ssl_match_hostname
Requirement already up-to-date:
backports.ssl_match_hostname in /usr/local/lib/python2.7/dist-packages (3.7.0.1)

Uninstalling and reinstalling docker-compose, emmmm, is also useless.

The final cause of the problem is:

**/usr/local/lib/python2.7/distpackages/docker/transport/ssladapter.py **
I can’t find the ssl_match_hostname module in the backports package under the package path.
In that case, let the script be able to find that module.

Final solution:

Method 1: Copy the module to the package path [Success].

#Go to the backports module path
cd /usr/local/lib/python2.7/dist-packages
#Copy the entire package to the transport package path
cp -r backports /usr/local/lib/python2.7/dist-packages/docker/transport

Problem 2

ImportError: No module named shutil_get_terminal_size

Solution

sudo apt install ipython

View version

sudo docker-compose version

Similar Posts: