类型下面这种错误:

未知错误: Traceback (most recent call last): File "class/flask_sockets.py", line 30, in __call__ handler, values = adapter.match() File "/www/server/panel/pyenv/lib/python3.7/site-packages/werkzeug/routing.py", line 1945, in match raise NotFound() werkzeug.exceptions.NotFound: 404 Not Found: The requested URL was not found on the server. If you entered the URL manually please check your spelling and try again. During handling of the above exception, another exception occurred: Traceback (most recent call last): File "class/ssh_terminal.py", line 110, in connect pkey = paramiko.RSAKey.from_private_key(p_file) File "/www/server/panel/pyenv/lib/python3.7/site-packages/paramiko/pkey.py", line 256, in from_private_key key = cls(file_obj=file_obj, password=password) File "/www/server/panel/pyenv/lib/python3.7/site-packages/paramiko/rsakey.py", line 52, in __init__ self._from_private_key(file_obj, password) File "/www/server/panel/pyenv/lib/python3.7/site-packages/paramiko/rsakey.py", line 180, in _from_private_key self._decode_key(data) File "/www/server/panel/pyenv/lib/python3.7/site-packages/paramiko/rsakey.py", line 202, in _decode_key ).private_key(default_backend()) File "/www/server/panel/pyenv/lib/python3.7/site-packages/cryptography/hazmat/primitives/asymmetric/rsa.py", line 311, in private_key return backend.load_rsa_private_numbers(self) File "/www/server/panel/pyenv/lib/python3.7/site-packages/cryptography/hazmat/backends/openssl/backend.py", line 630, in load_rsa_private_numbers return _RSAPrivateKey(self, rsa_cdata, evp_pkey) File "/www/server/panel/pyenv/lib/python3.7/site-packages/cryptography/hazmat/backends/openssl/rsa.py", line 320, in __init__ raise ValueError("Invalid private key", errors) ValueError: ('Invalid private key', [_OpenSSLErrorWithText(code=67764350, lib=4, func=160, reason=126, reason_text=b'error:040A007E:rsa routines:RSA_check_key_ex:iqmp not inverse of q')])

参照前辈经验, 卸载 paramiko 插件重新安装就可以了

cd /www/server/panel/pyenv/bin
./pip uninstall paramiko
./pip install paramiko

实际效果:
我的是windows宝塔
先找到命令行shell
在这里插入图片描述

在这里插入图片描述
重新安装后,宝塔未知错误: Traceback (most recent call last) 消失,修复完成!
记录在此,以帮助其它才坑人!!!
关于如何使用pin,可以参考另一篇文章 https://wkj006.blog.csdn.net/article/details/118570023

Logo

为开发者提供学习成长、分享交流、生态实践、资源工具等服务,帮助开发者快速成长。

更多推荐