Issue
We installed the docker and docker-compose on our Linux red-hat 7.2
instructions - from the link - href="https://github.com/NaturalHistoryMuseum/scratchpads2/wiki/Install-Docker-and-Docker-Compose-(Centos-7)" rel="nofollow noreferrer">https://github.com/NaturalHistoryMuseum/scratchpads2/wiki/Install-Docker-and-Docker-Compose-(Centos-7)
Docker is running fine
But on docker-compose we get the following ( we installed it by pip install docker-compose
)
docker-compose --version
Traceback (most recent call last):
File "/usr/bin/docker-compose", line 7, in <module>
from compose.cli.main import main
File "/usr/lib/python2.7/site-packages/compose/cli/main.py", line 23, in <module>
from ..bundle import get_image_digests
File "/usr/lib/python2.7/site-packages/compose/bundle.py", line 12, in <module>
from .config.serialize import denormalize_config
File "/usr/lib/python2.7/site-packages/compose/config/__init__.py", line 6, in <module>
from .config import ConfigurationError
File "/usr/lib/python2.7/site-packages/compose/config/config.py", line 50, in <module>
from .validation import match_named_volumes
File "/usr/lib/python2.7/site-packages/compose/config/validation.py", line 12, in <module>
from jsonschema import Draft4Validator
File "/usr/lib/python2.7/site-packages/jsonschema/__init__.py", line 33, in <module>
import importlib_metadata as metadata
File "/usr/lib/python2.7/site-packages/importlib_metadata/__init__.py", line 15, in <module>
from ._compat import (
File "/usr/lib/python2.7/site-packages/importlib_metadata/_compat.py", line 19, in <module>
from backports.configparser import ConfigParser
ImportError: No module named configparser
we try many steps in order to solve the issue about docker-compose failed on No module
, but without success ( each time its failed on other missing module )
any idea how to continue from this stage?
pip --version
pip 19.3.1 from /usr/lib/python2.7/site-packages/pip (python 2.7)
[root@server_mangmnt01]# pip show docker-compose
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
Name: docker-compose
Version: 1.25.0
Summary: Multi-container orchestration for Docker
Home-page: https://www.docker.com/
Author: Docker, Inc.
Author-email: None
License: Apache License 2.0
Location: /usr/lib/python2.7/site-packages
Requires: PyYAML, backports.ssl-match-hostname, texttable, enum34, ipaddress, subprocess32, jsonschema, dockerpty, websocket-client, docker, cached-property, backports.shutil-get-terminal-size, docopt, six, requests
Required-by:
[root@server_mangmnt01]# pip show docker
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
Name: docker
Version: 4.1.0
Summary: A Python library for the Docker Engine API.
Home-page: https://github.com/docker/docker-py
Author: None
Author-email: None
License: Apache License 2.0
Location: /usr/lib/python2.7/site-packages
Requires: six, ipaddress, backports.ssl-match-hostname, requests, websocket-client
Required-by: docker-compose
Solution
In my case : docker-compose didn`t support python2 But yum in CentOS not supported python3 - remember it !
For switch python version I replaced in /usr/bin symbilic link on python form python2 to python3
P.S. In CentOs i use midnight commander (mc) see screenshot
Answered By - Ruslan Novikov Answer Checked By - Candace Johnson (WPSolving Volunteer)