#python #python_3x #paramiko
Имеется Python 3.5.1 x64, Win 7 x64/. При попытке запуска .exe выходил ошибка, что можно с этим сделать? Traceback (most recent call last): File "test.py", line 83, inFile "site-packages\paramiko\transport.py", line 1073, in connect File "site-packages\paramiko\transport.py", line 493, in start_client File "site-packages\paramiko\transport.py", line 1757, in run File "site-packages\paramiko\kex_group1.py", line 75, in parse_next File "site-packages\paramiko\kex_group1.py", line 111, in _parse_kexdh_reply File "site-packages\paramiko\transport.py", line 1602, in _verify_key File "site-packages\paramiko\rsakey.py", line 58, in __init__ File "site-packages\cryptography\hazmat\backends\__init__.py", line 35, in def ault_backend File "site-packages\cryptography\hazmat\backends\multibackend.py", line 33, in __init__ ValueError: Multibackend cannot be initialized with no backends. If you are seei ng this error when trying to use default_backend() please try uninstalling and r einstalling cryptography. Failed to execute script test
Ответы
Ответ 1
Решение описано здесь https://github.com/pyinstaller/pyinstaller/issues/2013 Создаем метод def patch_crypto_be_discovery(): """ Monkey patches cryptography's backend detection. Objective: support pyinstaller freezing. """ from cryptography.hazmat import backends try: from cryptography.hazmat.backends.commoncrypto.backend import backend as be_cc except ImportError: be_cc = None try: from cryptography.hazmat.backends.openssl.backend import backend as be_ossl except ImportError: be_ossl = None backends._available_backends_list = [ be for be in (be_cc, be_ossl) if be is not None ] и вызываем patch_crypto_be_discovery() перед началом работы с paramiko
Комментариев нет:
Отправить комментарий