diff --git a/utils/general.py b/utils/general.py index f77ae3331538..fbb99b9e7f99 100755 --- a/utils/general.py +++ b/utils/general.py @@ -117,8 +117,8 @@ def check_requirements(requirements='requirements.txt', exclude=()): pkg.require(r) except Exception as e: # DistributionNotFound or VersionConflict if requirements not met n += 1 - print(f"{prefix} {e.req} not found and is required by YOLOv5, attempting auto-update...") - print(subprocess.check_output(f"pip install {e.req}", shell=True).decode()) + print(f"{prefix} {r} not found and is required by YOLOv5, attempting auto-update...") + print(subprocess.check_output(f"pip install '{r}'", shell=True).decode()) if n: # if packages updated source = file.resolve() if 'file' in locals() else requirements