Merge pull request #314 from MuWinds/debug

Fix:推理gui报ImportError
pull/334/head
SengokuCola 2025-03-13 13:05:58 +08:00 committed by GitHub
commit 2622f85901
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 1 deletions

View File

@ -7,7 +7,7 @@ from datetime import datetime
from typing import Dict, List
from loguru import logger
from typing import Optional
from ..common.database import db
import customtkinter as ctk
from dotenv import load_dotenv
@ -16,6 +16,8 @@ from dotenv import load_dotenv
current_dir = os.path.dirname(os.path.abspath(__file__))
# 获取项目根目录
root_dir = os.path.abspath(os.path.join(current_dir, '..', '..'))
sys.path.insert(0, root_dir)
from src.common.database import db
# 加载环境变量
if os.path.exists(os.path.join(root_dir, '.env.dev')):