Skip to content

[bug] OCCM_Web-Linux-x64 二进制文件缺少 bcrypt 等依赖 #39

@qiyuanhuakai

Description

@qiyuanhuakai

问题描述

我在wsl2 Ubuntu上运行OCCM_Web_v1.8.0/OCCM_Web_v1.8.0时报错信息如下,为缺失python包bcrypt:

Traceback (most recent call last):
File "occm_web_launcher.py", line 14, in
File "pyimod02_importers.py", line 457, in exec_module
File "occm_web/init.py", line 3, in
from .app import configure_app
File "pyimod02_importers.py", line 457, in exec_module
File "occm_web/app.py", line 12, in
from .auth import AuthManager, register_auth_api, register_login_pages
File "pyimod02_importers.py", line 457, in exec_module
File "occm_web/auth.py", line 15, in
import bcrypt
ModuleNotFoundError: No module named 'bcrypt'
[PYI-19508:ERROR] Failed to execute script 'occm_web_launcher' due to unhandled exception

原因分析

我检查了.github/workflows/build.yml文件,并注意到现有的打包流程缺失了安装相关依赖的步骤:

name: 安装 Python 依赖
run: |
python -m pip install --upgrade pip setuptools wheel
pip install nicegui requests pyinstaller
- name: PyInstaller 打包
run: |
pyinstaller
--name "OCCM_Web_${{ env.TAG_NAME }}"
--onedir --console
--add-data "occm_web:occm_web"
--add-data "occm_core:occm_core"
--add-data "locales:locales"
--hidden-import=nicegui --hidden-import=nicegui.elements
--hidden-import=nicegui.ui --hidden-import=uvicorn
--hidden-import=starlette --hidden-import=fastapi
--hidden-import=httptools --hidden-import=websockets
--hidden-import=requests --hidden-import=urllib3 --hidden-import=certifi
--collect-data nicegui --collect-submodules nicegui
--exclude-module torch --exclude-module tensorflow
--exclude-module scipy --exclude-module matplotlib
--exclude-module pandas --exclude-module numpy
--exclude-module PIL --exclude-module IPython
--exclude-module pytest --exclude-module PyQt5
--exclude-module qfluentwidgets
--noconfirm --strip
occm_web_launcher.py

显然,这里并没有安装和打包bcryptPyJWT

建议修复

在打包流程中正确添加所有依赖。
注意:我并没有检查所有版本的打包流程,因此其他版本可能或可能不存在相关问题

环境信息

Python 版本:3.13.9
操作系统:WSL2 Ubuntu

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions