You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Curriculum_Design/run_magicword.sh

29 lines
966 B

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

#!/bin/bash
# MagicWord 一键启动脚本
# 自动处理PyQt5平台插件问题
echo "🚀 正在启动 MagicWord..."
# 设置PyQt5环境变量
export QT_PLUGIN_PATH="/Users/maziang/Documents/CodingWorkPlace/Code/Curriculum_Design/.venv/lib/python3.9/site-packages/PyQt5/Qt5/plugins"
export QT_QPA_PLATFORM_PLUGIN_PATH="/Users/maziang/Documents/CodingWorkPlace/Code/Curriculum_Design/.venv/lib/python3.9/site-packages/PyQt5/Qt5/plugins/platforms"
export QT_QPA_PLATFORM="cocoa"
export QT_MAC_WANTS_LAYER="1"
export QT_LOGGING_RULES="qt.qpa.*=false"
# 激活虚拟环境(如果未激活)
if [ -z "$VIRTUAL_ENV" ]; then
echo "📦 激活虚拟环境..."
source .venv/bin/activate
fi
# 检查PyQt5是否可用
python -c "from PyQt5.QtWidgets import QApplication" 2>/dev/null
if [ $? -ne 0 ]; then
echo "❌ PyQt5出现问题正在修复..."
./emergency_fix.sh
fi
# 启动应用
echo "✅ 启动 MagicWord 应用..."
cd src && python main.py