1. 程式人生 > >安裝keras 報/OpenSSL/SSL.py", 錯誤

安裝keras 報/OpenSSL/SSL.py", 錯誤

python

[root@worker02 bin]# ./pip3.6 install keras

Collecting kerras

From cffi callback <function _verify_callback at 0x7f0362e35bf8>:

Traceback (most recent call last):

File "/opt/anaconda3/lib/python3.6/site-packages/OpenSSL/SSL.py", line 313, in wrapper

_lib.X509_up_ref(x509)

AttributeError: module 'lib' has no attribute 'X509_up_ref'

Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError("bad handshake: Error([('SSL routines', 'ssl3_get_server_certificate', 'certificate verify failed')],)",),)': /simple/kerras/

From cffi callback <function _verify_callback at 0x7f0362e271e0>:

Traceback (most recent call last):

File "/opt/anaconda3/lib/python3.6/site-packages/OpenSSL/SSL.py", line 313, in wrapper

_lib.X509_up_ref(x509)

AttributeError: module 'lib' has no attribute 'X509_up_ref'

Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError("bad handshake: Error([('SSL routines', 'ssl3_get_server_certificate', 'certificate verify failed')],)",),)': /simple/kerras/

From cffi callback <function _verify_callback at 0x7f0362e272f0>:

Traceback (most recent call last):

File "/opt/anaconda3/lib/python3.6/site-packages/OpenSSL/SSL.py", line 313, in wrapper

_lib.X509_up_ref(x509)

AttributeError: module 'lib' has no attribute 'X509_up_ref'

Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError("bad handshake: Error([('SSL routines', 'ssl3_get_server_certificate', 'certificate verify failed')],)",),)': /simple/kerras/

From cffi callback <function _verify_callback at 0x7f0362e27400>:

Traceback (most recent call last):

File "/opt/a3/lib/python3.6/site-packages/OpenSSL/SSL.py", line 313, in wrappernaconda

_lib.X509_up_ref(x509)

AttributeError: module 'lib' has no attribute 'X509_up_ref'

Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError("bad handshake: Error([('SSL routines', 'ssl3_get_server_certificate', 'certificate verify failed')],)",),)': /simple/kerras/

From cffi callback <function _verify_callback at 0x7f0362e27510>:


按照上面的錯誤提示應該是pyOpenSSL出現問題了,將pyOpenSSL卸載後重新安裝

[root@worker02 bin]# ./pip uninstall pyOpenSSL

[root@worker02 bin]# ./pip install pyOpenSSL

Collecting pyOpenSSL

Downloading https://files.pythonhosted.org/packages/96/af/9d29e6bd40823061aea2e0574ccb2fcf72bfd6130ce53d32773ec375458c/pyOpenSSL-18.0.0-py2.py3-none-any.whl (53kB)

100% |████████████████████████████████| 61kB 343kB/s

Collecting cryptography>=2.2.1 (from pyOpenSSL)

Downloading https://files.pythonhosted.org/packages/fa/f4/3cde3604972dfa2b0fea85b9711948bb4fb70ab64095322aef35071bd254/cryptography-2.2.2-cp34-abi3-manylinux1_x86_64.whl (2.2MB)

100% |████████████████████████████████| 2.2MB 1.6MB/s

Requirement already satisfied: six>=1.5.2 in /opt/anaconda3/lib/python3.6/site-packages (from pyOpenSSL) (1.11.0)

Requirement already satisfied: idna>=2.1 in /opt/anaconda3/lib/python3.6/site-packages (from cryptography>=2.2.1->pyOpenSSL) (2.6)

Requirement already satisfied: cffi>=1.7; platform_python_implementation != "PyPy" in /opt/anaconda3/lib/python3.6/site-packages (from cryptography>=2.2.1->pyOpenSSL) (1.11.5)

Requirement already satisfied: asn1crypto>=0.21.0 in /opt/anaconda3/lib/python3.6/site-packages (from cryptography>=2.2.1->pyOpenSSL) (0.24.0)

Requirement already satisfied: pycparser in /opt/anaconda3/lib/python3.6/site-packages (from cffi>=1.7; platform_python_implementation != "PyPy"->cryptography>=2.2.1->pyOpenSSL) (2.18)

Installing collected packages: cryptography, pyOpenSSL

Found existing installation: cryptography 2.2

Uninstalling cryptography-2.2:

Successfully uninstalled cryptography-2.2

Successfully installed cryptography-2.2.2 pyOpenSSL-18.0.0


再次嘗試安裝keras 成功!~

[root@worker02 bin]# ./pip install keras

Collecting keras

Downloading https://files.pythonhosted.org/packages/54/e8/eaff7a09349ae9bd40d3ebaf028b49f5e2392c771f294910f75bb608b241/Keras-2.1.6-py2.py3-none-any.whl (339kB)

100% |████████████████████████████████| 348kB 2.3MB/s

Requirement already satisfied: six>=1.9.0 in /opt/anaconda3/lib/python3.6/site-packages (from keras) (1.11.0)

Requirement already satisfied: h5py in /opt/anaconda3/lib/python3.6/site-packages (from keras) (2.7.1)

Requirement already satisfied: pyyaml in /opt/anaconda3/lib/python3.6/site-packages (from keras) (3.12)

Requirement already satisfied: numpy>=1.9.1 in /opt/anaconda3/lib/python3.6/site-packages (from keras) (1.14.2)

Requirement already satisfied: scipy>=0.14 in /opt/anaconda3/lib/python3.6/site-packages (from keras) (1.0.0)

Installing collected packages: keras

Successfully installed keras-2.1.6




安裝keras 報/OpenSSL/SSL.py", 錯誤