79 lines
2.0 KiB
Python
79 lines
2.0 KiB
Python
#!/usr/bin/env python3
|
||
# -*- coding: utf-8 -*-
|
||
"""
|
||
验证MetaCore安装是否正确
|
||
"""
|
||
|
||
import sys
|
||
import os
|
||
|
||
def main():
|
||
print("=" * 50)
|
||
print("🧪 MetaCore安装验证")
|
||
print("=" * 50)
|
||
|
||
# 检查Python版本
|
||
print(f"🐍 Python版本: {sys.version}")
|
||
print(f"📁 Python路径: {sys.executable}")
|
||
|
||
# 检查PyQt5
|
||
try:
|
||
import PyQt5
|
||
from PyQt5.QtWidgets import QApplication
|
||
from PyQt5.QtCore import QT_VERSION_STR, PYQT_VERSION_STR
|
||
print(f"✅ PyQt5版本: {PYQT_VERSION_STR}")
|
||
print(f"✅ Qt版本: {QT_VERSION_STR}")
|
||
|
||
# 测试创建应用
|
||
app = QApplication([])
|
||
print("✅ PyQt5可以正常创建应用程序")
|
||
app.quit()
|
||
|
||
except ImportError as e:
|
||
print(f"❌ PyQt5导入失败: {e}")
|
||
return False
|
||
|
||
# 检查项目文件
|
||
required_files = [
|
||
'main.py',
|
||
'ui/main_window.py',
|
||
'data/project_manager.py'
|
||
]
|
||
|
||
print("\n📁 检查项目文件:")
|
||
for file_path in required_files:
|
||
if os.path.exists(file_path):
|
||
print(f"✅ {file_path}")
|
||
else:
|
||
print(f"❌ {file_path} (缺失)")
|
||
return False
|
||
|
||
# 测试模块导入
|
||
print("\n📦 测试模块导入:")
|
||
try:
|
||
sys.path.insert(0, os.getcwd())
|
||
from ui.main_window import MainWindow
|
||
from data.project_manager import ProjectManager
|
||
print("✅ 所有模块导入成功")
|
||
except Exception as e:
|
||
print(f"❌ 模块导入失败: {e}")
|
||
return False
|
||
|
||
print("\n" + "=" * 50)
|
||
print("🎉 验证完成!")
|
||
print("✅ MetaCore安装正确,可以正常运行")
|
||
print("\n🚀 启动命令:")
|
||
print(" python main.py")
|
||
print(" 或双击: 启动MetaCore.bat")
|
||
print("=" * 50)
|
||
|
||
return True
|
||
|
||
if __name__ == "__main__":
|
||
success = main()
|
||
if not success:
|
||
print("\n❌ 验证失败,请检查安装")
|
||
input("按Enter键退出...")
|
||
else:
|
||
input("按Enter键退出...")
|