宝塔Linux面板添加站点提示“TypeError: deprecated() got an unexpected keyword argument 'name'”的解决办法
[重要通告]如您遇疑难杂症,本站支持知识付费业务,扫右边二维码加博主微信,可节省您宝贵时间哦!
今天闲着蛋疼给自己以前的一个垃圾服务器装一个宝塔Linux控制面板,这东西不说每天给客户装吧,好歹也经常装,今天给自己装完是正常,再安装“网站监控报表”的时候就特么的出错了,错误还挺奇葩,以前没注意过这个错误头部显示“TypeError: deprecated() got an unexpected keyword argument 'name'”下面是大致的错误 如下文字与图所示
Traceback (most recent call last):
File "/www/server/panel/pyenv/lib/python3.7/site-packages/flask/app.py", line 2529, in wsgi_app
response = self.full_dispatch_request()
File "/www/server/panel/pyenv/lib/python3.7/site-packages/flask/app.py", line 1825, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/www/server/panel/pyenv/lib/python3.7/site-packages/flask/app.py", line 1823, in full_dispatch_request
rv = self.dispatch_request()
File "/www/server/panel/pyenv/lib/python3.7/site-packages/flask/app.py", line 1799, in dispatch_request
return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
File "/www/server/panel/BTPanel/__init__.py", line 400, in site
import panelSite
File "class/panelSite.py", line 15, in
import OpenSSL
File "/www/server/panel/pyenv/lib/python3.7/site-packages/OpenSSL/__init__.py", line 8, in
from OpenSSL import SSL, crypto
File "/www/server/panel/pyenv/lib/python3.7/site-packages/OpenSSL/SSL.py", line 34, in
from OpenSSL.crypto import (
File "/www/server/panel/pyenv/lib/python3.7/site-packages/OpenSSL/crypto.py", line 953, in
name="X509Extension",
TypeError: deprecated() got an unexpected keyword argument 'name'
宝塔Linux面板添加站点提示“TypeError: deprecated() got an unexpected keyword argument 'name'”的解决办法
看到““TypeError: deprecated() got an unexpected keyword argument 'name'”其实是懵逼的,查询了好多资料都没有能成功,都快崩溃了,然而出去喝了会儿酒,哟呵~~好像发现了新大陆;
其实我一直看的错误是“TypeError: deprecated() got an unexpected keyword argument 'name'”,一直盯着,其实也看到有人说cryptography、pyOpenSSL版本太旧造成的,但我还是把错误都复制到记事本查看,也没看出啥症状,有人说可能是“paramiko插件”问题,死马当活马医;连接SSH开始测试;
一、既然错误,那就卸载paramiko插件从新安装paramiko插件;
cd /www/server/panel/pyenv/bin #进入paramiko插件目录 ./pip uninstall paramiko # 卸载paramiko插件 会问是否卸载 Proceed (y/n)? y 小写 ./pip install paramiko # 安装 paramiko插件
二、安装完之后,貌似有告知,注意,这不是错误,是告知你东西可以用,但建议你升级!
ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
aliyun-python-sdk-core 2.13.30 requires cryptography<3.3,>=2.9.2, but you have cryptography 42.0.7 which is incompatible.
Successfully installed cryptography-42.0.7 paramiko-3.4.0 pynacl-1.5.0
WARNING: You are using pip version 20.3.3; however, version 24.0 is available.
You should consider upgrading via the '/www/server/panel/pyenv/bin/python3.7 -m pip install --upgrade pip' command.
三、既然建议升级,那就听取建议,升级一下;听人劝吃饱饭!输入如下代码,直接回车即可:
/www/server/panel/pyenv/bin/python3.7 -m pip install --upgrade pip
四、提示升级完成
写在最后,其实不知道咋回事儿,它也竟然真的好了,一开始还想着琢磨flask或OpenSSL,甚至大小写的问题,最终还是看了一篇文章感觉有点儿意思,就听了劝,总算搞定了!
问题未解决?付费解决问题加Q或微信 2589053300 (即Q号又微信号)右上方扫一扫可加博主微信
所写所说,是心之所感,思之所悟,行之所得;文当无敷衍,落笔求简洁。 以所舍,求所获;有所依,方所成!