通過pip安裝docker-compse后,用docker-compose啟動(dòng)容器,報(bào)如下錯(cuò)誤:
...
AttributeError: module 'websocket._ssl_compat' has no attribute 'ssl'
進(jìn)入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 "<stdin>", line 1, in <module>
File "/usr/lib64/python3.6/ssl.py", line 101, in <module>
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確定是安裝了的, 此時(shí)只需要進(jìn)入/lib64
把libcrypto.so.10
軟連接改個(gè)版本即可
[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