宝塔10周年开年大促,年度钜惠,先领红包再下单,享受折上折,还有抽奖!查看活动
当前位置:论坛首页 > Linux面板 > 求助

【已解答】No module named 'cbor2'升级到11.6版出错

发表在 Linux面板6 天前 [复制链接] 4 119

为了能快速了解并处理您的问题,请提供以下基础信息:
面板、插件版本:v11.3
系统版本:Alibaba Cloud  3 (OpenAnolis Edition) x86_64(Py3.7.16)
问题描述:升级到11.6后报错,无法进入登录界面
相关截图(日志、错误):

出错了,面板运行时发生错误!            ModuleNotFoundError: No module named 'cbor2'   
    REQUEST_DATE: 2026-03-10 13:10:28  VERSION: Alibaba Cloud  3 (OpenAnolis Edition) x86_64(Py3.7.16) - 11.6.0 REMOTE_ADDR: xx.xx.154.190 REQUEST_URI: GET /?REQUEST_FORM: {}  USER_AGENT: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:146.0) Gecko/20100101 Firefox/146.0    Traceback (most recent call last):  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 538, in home    comReturn = comm.local()  File "class/common.py", line 134, in local    result = self.setSession()  File "class/common.py", line 149, in setSession    import config  File "class/config.py", line 16, in <module>    from webauthn_util import WebAuthn  File "class/webauthn_util.py", line 12, in <module>    from webauthn import (  File "class/webauthn/__init__.py", line 1, in <module>    from .registration.generate_registration_options import generate_registration_options  File "class/webauthn/registration/generate_registration_options.py", line 3, in <module>    from webauthn.helpers import generate_challenge, generate_user_handle, byteslike_to_bytes  File "class/webauthn/helpers/__init__.py", line 5, in <module>    from .decode_credential_public_key import decode_credential_public_key  File "class/webauthn/helpers/decode_credential_public_key.py", line 4, in <module>    import cbor2ModuleNotFoundError: No module named 'cbor2'   
  • 很抱歉,面板运行时意外发生错误,请尝试按以下顺序尝试解除此错误:
  • 修复方案一:在[首页]右上角点击修复面板,并退出面板重新登录。[url=]尝试点击修复[/url]
  • 修复方案二:如上述尝试未能解除此错误,请截图此窗口到宝塔论坛发贴寻求帮助, 论坛地址:https://www.bt.cn/bbs
使用道具 举报 只看该作者 回复
发表于 6 天前 | 显示全部楼层
您好,您到SSH终端执行
  1. btpip install cbor2==5.4.6
复制代码

如果还有其他依赖包的故障,可以尝试备份python环境后,重新覆盖安装
  1. mv /www/server/panel/pyenv /www/backup/pyenv_backup
  2. if [ -f /usr/bin/curl ];then curl -sSO https://download.bt.cn/install/install_panel.sh;else wget -O install_panel.sh https://download.bt.cn/install/install_panel.sh;fi;bash install_panel.sh ed8484bec
复制代码
使用道具 举报 回复 支持 反对
发表于 5 天前 | 显示全部楼层
大炮运维V587 发表于 2026-3-10 16:37
您好,您到SSH终端执行

如果还有其他依赖包的故障,可以尝试备份python环境后,重新覆盖安装

感谢!是缺了2个包,cbor2 和 asn1crypto,用默认的源提示错误,可能就是因为这个才造这2个包安装失败,换了阿里的源就行了。
/www/server/panel/pyenv/bin/pip3 install cbor2 -i https://mirrors.aliyun.com/pypi/simple/
/www/server/panel/pyenv/bin/pip3 install asn1crypto -i https://mirrors.aliyun.com/pypi/simple/
使用道具 举报 回复 支持 反对
您好,我的问题跟上面一样,按您的说明在执行的时候,btpip install cbor2==5.4.6的时候,提示下面的信息:

WARNING: You are using pip version 21.1.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.
使用道具 举报 回复 支持 反对
大炮运维V587 发表于 2026-3-10 16:37
您好,您到SSH终端执行

如果还有其他依赖包的故障,可以尝试备份python环境后,重新覆盖安装

按您说的执行btpip install cbor2==5.4.6,失败,提示信息:

Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple
Collecting cbor2==5.4.6
  ERROR: HTTP error 403 while getting https://pypi.tuna.tsinghua.edu.cn/packages/a0/c2/ef6830816831a9ec276f45270de1029513f12255610a81673b285484a829/cbor2-5.4.6-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl#sha256=e5094562dfe3e5583202b93ef7ca5082c2ba5571accb2c4412d27b7d0ba8a563 (from https://pypi.tuna.tsinghua.edu.cn/simple/cbor2/) (requires-python:>=3.7)
ERROR: Could not install requirement cbor2==5.4.6 from https://pypi.tuna.tsinghua.edu.cn/packages/a0/c2/ef6830816831a9ec276f45270de1029513f12255610a81673b285484a829/cbor2-5.4.6-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl#sha256=e5094562dfe3e5583202b93ef7ca5082c2ba5571accb2c4412d27b7d0ba8a563 because of HTTP error 403 Client Error: Forbidden for url: https://pypi.tuna.tsinghua.edu.cn/packages/a0/c2/ef6830816831a9ec276f45270de1029513f12255610a81673b285484a829/cbor2-5.4.6-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl for URL https://pypi.tuna.tsinghua.edu.cn/packages/a0/c2/ef6830816831a9ec276f45270de1029513f12255610a81673b285484a829/cbor2-5.4.6-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl#sha256=e5094562dfe3e5583202b93ef7ca5082c2ba5571accb2c4412d27b7d0ba8a563 (from https://pypi.tuna.tsinghua.edu.cn/simple/cbor2/) (requires-python:>=3.7)
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.

备份python环境后,重新覆盖安装,依然是这个问题,请教下,怎么解决好呢?
使用道具 举报 回复 支持 反对
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

紧急运维服务

响应时间:3分钟

问题处理方式:宝塔专家1对1服务

工作时间:工作日:9:00 - 18:30

宝塔专业团队为您解决服务器疑难问题

点击联系技术分析

工作时间:09:00至18:30

快速回复 返回顶部 返回列表