寶塔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號又微信號)右上方掃一掃可加博主微信
所寫所說,是心之所感,思之所悟,行之所得;文當無敷衍,落筆求簡潔。 以所舍,求所獲;有所依,方所成!