docker-compose 启动提示 has no attribute 'ssl'

通过pip安装docker-compse后,用docker-compose启动容器,报如下错误:

...
AttributeError: module 'websocket._ssl_compat' has no attribute 'ssl'

进入python编辑器, 我用的是python3

[root@test ~]# python3
Python 3.6.8 (default, xxxxx) 
[GCC 4.8.5 20150623 (Red Hat 4.8.5-36)] on linux
>>> import ssl
Traceback (most recent call last):
  File "", line 1, in 
  File "/usr/lib64/python3.6/ssl.py", line 101, in 
    import _ssl             # if we can't import it, let the error propagate
ImportError: /lib64/libcrypto.so.10: version `OPENSSL_1.0.2' not found (required by /usr/lib64/python3.6/lib-dynload/_ssl.cpython-36m-x86_64-linux-gnu.so)

OPENSSL确定是安装了的, 此时只需要进入/lib64libcrypto.so.10软连接改个版本即可

[root@test ~]# cd /lib64
[root@test lib64]# ll|grep libcrypto
-rw-r--r--   1 root root     4688496 Mar 12 18:12 libcrypto.a
lrwxrwxrwx   1 root root          19 Jul 30 11:20 libcrypto.so -> libcrypto.so.1.0.2k
-rwxr-xr-x.  1 root root     1440048 Jun 20  2014 libcrypto.so.0.9.8
-rwxr-xr-x   1 root root     1440256 Mar  9  2016 libcrypto.so.0.9.8e
lrwxrwxrwx   1 root root          19 Jul 30 11:18 libcrypto.so.10 -> libcrypto.so.1.0.2n
-rwxr-xr-x   1 root root     2516624 Mar 12 18:12 libcrypto.so.1.0.2k
-rwsrwsrwx   1 root root     3235193 Jan 29  2018 libcrypto.so.1.0.2n
lrwxrwxrwx   1 root root          19 Jul 30 11:24 libcrypto.so.6 -> libcrypto.so.0.9.8e

libcrypto.so.10 -> libcrypto.so.1.0.2n改成libcrypto.so.10 -> libcrypto.so.1.0.2k

[root@test lib64]# rm libcrypto.so.10 
[root@test lib64]# ln -s libcrypto.so.1.0.2k libcrypto.so.10

你可能感兴趣的:(docker-compose 启动提示 has no attribute 'ssl')