Deepfake-Detector / fix_dependencies.py
AZIIIIIIIIZ's picture
Upload 1039 files
d670799 verified
#!/usr/bin/env python3
"""
Script to fix dependency version conflicts
"""
import subprocess
import sys
def run_command(cmd):
"""Run a command and return success status"""
try:
print(f"Running: {cmd}")
result = subprocess.run(cmd, shell=True, check=True, capture_output=True, text=True)
print(f"βœ… Success: {cmd}")
return True
except subprocess.CalledProcessError as e:
print(f"❌ Error: {cmd}")
print(f"Error output: {e.stderr}")
return False
def main():
"""Fix dependency issues"""
print("πŸ”§ Fixing dependency version conflicts...")
# Uninstall problematic packages
print("\nπŸ“¦ Uninstalling conflicting packages...")
packages_to_remove = [
"mmcv",
"mmdet",
"mmengine"
]
for package in packages_to_remove:
run_command(f"pip uninstall {package} -y")
# Install compatible versions
print("\nπŸ“¦ Installing compatible versions...")
compatible_packages = [
"mmcv>=2.0.0,<2.2.0",
"mmengine>=0.7.1,<1.0.0",
"mmdet>=3.0.0,<4.0.0"
]
for package in compatible_packages:
if not run_command(f"pip install {package}"):
print(f"⚠️ Failed to install {package}")
print("\nβœ… Dependency fix completed!")
print("Now run: python test_app.py")
if __name__ == "__main__":
main()