Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check_requirements() enclosing apostrophe bug fix #2929

Merged
merged 1 commit into from
Apr 25, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Check_requirements() enclosing apostrophe bug fix
This fixes a bug where the '>' symbol in python package requirements was not running correctly with subprocess.check_output() commands.
  • Loading branch information
glenn-jocher committed Apr 25, 2021
commit 01d63161abe86e99de9cb57f134bf953efcc0e86
4 changes: 2 additions & 2 deletions utils/general.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down