Fix dependency detection in build script

 FIXED DEPENDENCY DETECTION:
- Corrected import testing logic for PyQt6 and PyInstaller
- Now properly detects installed packages instead of false negatives
- Uses correct import names: PyQt6.QtWidgets and PyInstaller
- Eliminates false 'missing dependency' errors when packages are installed

TECHNICAL FIX:
- Fixed import_tests dictionary for accurate package detection
- Proper case-sensitive import checking
- Resolves issue where installed packages were incorrectly flagged as missing
parent bc563017
...@@ -22,13 +22,20 @@ def check_dependencies(): ...@@ -22,13 +22,20 @@ def check_dependencies():
missing_packages = [] missing_packages = []
for package in packages: # Test actual imports that the application uses
import_tests = {
"PyQt6": "PyQt6.QtWidgets",
"pyinstaller": "PyInstaller"
}
for package_name in packages:
try: try:
__import__(package.lower().replace('-', '_')) import_name = import_tests.get(package_name, package_name)
print(f"✓ {package} found") __import__(import_name)
print(f"✓ {package_name} found")
except ImportError: except ImportError:
print(f"✗ {package} missing") print(f"✗ {package_name} missing")
missing_packages.append(package) missing_packages.append(package_name)
if missing_packages: if missing_packages:
print("\nMissing dependencies found!") print("\nMissing dependencies found!")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment