forked from YongJin04/iOS-Forensics
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
35 lines (31 loc) · 1.06 KB
/
Copy pathmain.py
File metadata and controls
35 lines (31 loc) · 1.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import importlib
import sys
import subprocess
from pathlib import Path
def check_requirements(requirements_path="requirements.txt"):
"""Check if all requirements are installed."""
if not Path(requirements_path).exists():
print(f"Error: {requirements_path} not found.")
sys.exit(1)
missing_packages = []
with open(requirements_path, "r") as f:
for line in f:
line = line.strip()
if not line or line.startswith("#"):
continue
package = line.split("==")[0]
try:
importlib.import_module(package.replace("-", "_"))
except ImportError:
missing_packages.append(line)
if missing_packages:
print("\nThe following packages are missing:")
for pkg in missing_packages:
print(f" {pkg}")
print("\nPlease install them with:")
print(f" pip3 install -r {requirements_path}")
sys.exit(1)
if __name__ == "__main__":
#check_requirements()
from gui.main_window import start_gui
start_gui()