glenn-jocher
commited on
Commit
•
1849916
1
Parent(s):
9c7bb5a
Check_requirements() enclosing apostrophe bug fix (#2929)
Browse filesThis fixes a bug where the '>' symbol in python package requirements was not running correctly with subprocess.check_output() commands.
- utils/general.py +2 -2
utils/general.py
CHANGED
@@ -117,8 +117,8 @@ def check_requirements(requirements='requirements.txt', exclude=()):
|
|
117 |
pkg.require(r)
|
118 |
except Exception as e: # DistributionNotFound or VersionConflict if requirements not met
|
119 |
n += 1
|
120 |
-
print(f"{prefix} {
|
121 |
-
print(subprocess.check_output(f"pip install {
|
122 |
|
123 |
if n: # if packages updated
|
124 |
source = file.resolve() if 'file' in locals() else requirements
|
|
|
117 |
pkg.require(r)
|
118 |
except Exception as e: # DistributionNotFound or VersionConflict if requirements not met
|
119 |
n += 1
|
120 |
+
print(f"{prefix} {r} not found and is required by YOLOv5, attempting auto-update...")
|
121 |
+
print(subprocess.check_output(f"pip install '{r}'", shell=True).decode())
|
122 |
|
123 |
if n: # if packages updated
|
124 |
source = file.resolve() if 'file' in locals() else requirements
|