寶塔Linux面板添加站點(diǎn)提示“TypeError: deprecated() got an unexpected keyword argument 'name'”的解決辦法
[重要通告]如您遇疑難雜癥,本站支持知識(shí)付費(fèi)業(yè)務(wù),掃右邊二維碼加博主微信,可節(jié)省您寶貴時(shí)間哦!
今天閑著蛋疼給自己以前的一個(gè)垃圾服務(wù)器裝一個(gè)寶塔Linux控制面板,這東西不說每天給客戶裝吧,好歹也經(jīng)常裝,今天給自己裝完是正常,再安裝“網(wǎng)站監(jiān)控報(bào)表”的時(shí)候就特么的出錯(cuò)了,錯(cuò)誤還挺奇葩,以前沒注意過這個(gè)錯(cuò)誤頭部顯示“TypeError: deprecated() got an unexpected keyword argument 'name'”下面是大致的錯(cuò)誤 如下文字與圖所示
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面板添加站點(diǎn)提示“TypeError: deprecated() got an unexpected keyword argument 'name'”的解決辦法
看到““TypeError: deprecated() got an unexpected keyword argument 'name'”其實(shí)是懵逼的,查詢了好多資料都沒有能成功,都快崩潰了,然而出去喝了會(huì)兒酒,喲呵~~好像發(fā)現(xiàn)了新大陸;
其實(shí)我一直看的錯(cuò)誤是“TypeError: deprecated() got an unexpected keyword argument 'name'”,一直盯著,其實(shí)也看到有人說cryptography、pyOpenSSL版本太舊造成的,但我還是把錯(cuò)誤都復(fù)制到記事本查看,也沒看出啥癥狀,有人說可能是“paramiko插件”問題,死馬當(dāng)活馬醫(yī);連接SSH開始測(cè)試;
一、既然錯(cuò)誤,那就卸載paramiko插件從新安裝paramiko插件;
cd /www/server/panel/pyenv/bin? ? ?#進(jìn)入paramiko插件目錄 ./pip uninstall paramiko? ? #? 卸載paramiko插件 會(huì)問是否卸載 Proceed (y/n)? y 小寫 ./pip install paramiko? #? 安裝 paramiko插件
二、安裝完之后,貌似有告知,注意,這不是錯(cuò)誤,是告知你東西可以用,但建議你升級(jí)!
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.
三、既然建議升級(jí),那就聽取建議,升級(jí)一下;聽人勸吃飽飯!輸入如下代碼,直接回車即可:
/www/server/panel/pyenv/bin/python3.7 -m pip install --upgrade pip
四、提示升級(jí)完成
寫在最后,其實(shí)不知道咋回事兒,它也竟然真的好了,一開始還想著琢磨flask或OpenSSL,甚至大小寫的問題,最終還是看了一篇文章感覺有點(diǎn)兒意思,就聽了勸,總算搞定了!
問題未解決?付費(fèi)解決問題加Q或微信 2589053300 (即Q號(hào)又微信號(hào))右上方掃一掃可加博主微信
所寫所說,是心之所感,思之所悟,行之所得;文當(dāng)無敷衍,落筆求簡(jiǎn)潔。 以所舍,求所獲;有所依,方所成!