简体   繁体   English

无法在没有模块的情况下启动 docker-compose & failes

[英]Cant start docker-compose & failes on No module

We installed the docker and docker-compose on our Linux red-hat 7.2我们在 Linux red-hat 7.2 上安装了 docker 和 docker-compose

instructions - from the link - https://github.com/NaturalHistoryMuseum/scratchpads2/wiki/Install-Docker-and-Docker-Compose-(Centos-7)说明 - 来自链接 - https://github.com/NaturalHistoryMuseum/scratchpads2/wiki/Install-Docker-and-Docker-Compose-(Centos-7)

Docker is running fine Docker 运行良好

But on docker-compose we get the following ( we installed it by pip install docker-compose )但是在 docker-compose 上我们得到以下信息(我们通过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?我们尝试了很多步骤来解决关于 docker-compose 在No module时失败的问题,但没有成功(每次它在其他丢失的模块上失败)知道如何从这个阶段继续吗?

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

In my case: docker-compose didn`t support python2 But yum in CentOS not supported python3 - remember it !就我而言:docker-compose 不支持 python2 但 CentOS 中的 yum 不支持 python3 - 记住它!

For switch python version I replaced in /usr/bin symbilic link on python form python2 to python3对于 switch python 版本,我将 python 上的 /usr/bin 符号链接替换为 python2 到 python3

PS In CentOs i use midnight commander (mc) see screenshot PS 在 CentOs 中我使用 midnight commander (mc) 看截图

在此处输入图像描述

We installed the docker and docker-compose on our Linux red-hat 7.2我们在 Linux red-hat 7.2 上安装了 docker 和 docker-compose

instructions - from the link - https://github.com/NaturalHistoryMuseum/scratchpads2/wiki/Install-Docker-and-Docker-Compose-(Centos-7)说明 - 来自链接 - https://github.com/NaturalHistoryMuseum/scratchpads2/wiki/Install-Docker-and-Docker-Compose-(Centos-7)

Docker is running fine Docker 运行良好

But on docker-compose we get the following ( we installed it by pip install docker-compose )但是在 docker-compose 上我们得到以下内容(我们通过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?我们尝试了很多步骤来解决关于 docker-compose 在No module上失败的问题,但没有成功(每次它在其他缺少的模块上失败)知道如何从这个阶段继续吗?

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM