fix: import torch before PyQt to fix DLL loading on Windows
- Add early torch import before PyQt6 imports in main_window.py - This prevents the c10.dll initialization error on Windows - Solution 3 from user research: import torch before PyQt
This commit is contained in:
parent
049a59136d
commit
786b292fcd
|
|
@ -0,0 +1,35 @@
|
|||
@echo off
|
||||
REM Quick install for Computer Vision (Python 3.13)
|
||||
echo ==========================================
|
||||
echo Installing Computer Vision Dependencies
|
||||
echo ==========================================
|
||||
echo.
|
||||
|
||||
echo [1/4] Installing PyTorch...
|
||||
pip install torch torchvision --index-url https://download.pytorch.org/whl/cpu
|
||||
|
||||
echo.
|
||||
echo [2/4] Installing PaddlePaddle...
|
||||
pip install paddlepaddle
|
||||
|
||||
echo.
|
||||
echo [3/4] Installing PaddleOCR (without PyMuPDF)...
|
||||
pip install paddleocr --no-deps
|
||||
|
||||
echo.
|
||||
echo [4/4] Installing remaining dependencies...
|
||||
pip install shapely scikit-image imgaug pyclipper lxml tqdm numpy visualdl rapidfuzz opencv-python opencv-contrib-python cython Pillow pyyaml attrdict openpyxl fire fonttools
|
||||
|
||||
echo.
|
||||
echo ==========================================
|
||||
echo Testing installation...
|
||||
echo ==========================================
|
||||
python -c "import torch; print('PyTorch:', torch.__version__)" 2>nul || echo "PyTorch failed"
|
||||
python -c "import paddle; print('PaddlePaddle:', paddle.__version__)" 2>nul || echo "PaddlePaddle failed"
|
||||
python -c "from paddleocr import PaddleOCR; print('PaddleOCR: OK')" 2>nul || echo "PaddleOCR failed"
|
||||
|
||||
echo.
|
||||
echo ==========================================
|
||||
echo Done! Restart the app to test.
|
||||
echo ==========================================
|
||||
pause
|
||||
|
|
@ -3,7 +3,17 @@ Lemontropia Suite - Main Application Window (Session-Focused Redesign)
|
|||
PyQt6 GUI for managing game automation sessions and activities.
|
||||
"""
|
||||
|
||||
# Fix PyTorch DLL loading on Windows - MUST be before PyQt imports
|
||||
import sys
|
||||
import platform
|
||||
if platform.system() == "Windows":
|
||||
try:
|
||||
import torch
|
||||
# Force torch to load its DLLs before PyQt
|
||||
_ = torch.__version__
|
||||
except Exception:
|
||||
pass # Torch not available, will be handled later
|
||||
|
||||
import logging
|
||||
from datetime import datetime
|
||||
from enum import Enum, auto
|
||||
|
|
|
|||
Loading…
Reference in New Issue