|
|
|
|
|
"""
|
|
|
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...")
|
|
|
|
|
|
|
|
|
print("\nπ¦ Uninstalling conflicting packages...")
|
|
|
packages_to_remove = [
|
|
|
"mmcv",
|
|
|
"mmdet",
|
|
|
"mmengine"
|
|
|
]
|
|
|
|
|
|
for package in packages_to_remove:
|
|
|
run_command(f"pip uninstall {package} -y")
|
|
|
|
|
|
|
|
|
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()
|
|
|
|