报错信息:
# docker-compose -h
/usr/lib/python2.7/site-packages/paramiko/transport.py:33: CryptographyDeprecationWarning: Python 2 is no longer supported by the Python core team. Support for it is now deprecated in cryptography, and will be removed in the next release.
from cryptography.hazmat.backends import default_backend
Traceback (most recent call last):
File "/usr/bin/docker-compose", line 6, in <module>
from compose.cli.main import main
File "/usr/lib/python2.7/site-packages/compose/cli/main.py", line 24, in <module>
from ..config import ConfigurationError
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 51, 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 21, in <module>
from jsonschema._types import TypeChecker
File "/usr/lib/python2.7/site-packages/jsonschema/_types.py", line 3, in <module>
from pyrsistent import pmap
File "/usr/lib64/python2.7/site-packages/pyrsistent/__init__.py", line 3, in <module>
from pyrsistent._pmap import pmap, m, PMap
File "/usr/lib64/python2.7/site-packages/pyrsistent/_pmap.py", line 98
) from e
^
SyntaxError: invalid syntax
是pyristent版本(0.17.0)导致的问题。安装旧版本即可解决
# pip install pyrsistent==0.16.0