FROM ubuntu:lunar-20230615 and lap
install fixes (#3374)
This commit is contained in:
@ -13,7 +13,8 @@ try:
|
||||
except (ImportError, AssertionError, AttributeError):
|
||||
from ultralytics.yolo.utils.checks import check_requirements
|
||||
|
||||
check_requirements('lap>=0.4') # install
|
||||
check_requirements('cython') # required before installing lap from source
|
||||
check_requirements('git+https://github.com/gatagat/lap.git') # more reliable than 'pip install lap'
|
||||
import lap
|
||||
|
||||
|
||||
|
@ -222,12 +222,13 @@ def check_requirements(requirements=ROOT.parent / 'requirements.txt', exclude=()
|
||||
s = '' # console string
|
||||
n = 0 # number of packages updates
|
||||
for r in requirements:
|
||||
rmin = r.split('/')[-1].replace('.git', '') # replace git+https://org/repo.git -> 'repo'
|
||||
try:
|
||||
pkg.require(r)
|
||||
pkg.require(rmin)
|
||||
except (pkg.VersionConflict, pkg.DistributionNotFound): # exception if requirements not met
|
||||
try: # attempt to import (slower but more accurate)
|
||||
import importlib
|
||||
importlib.import_module(next(pkg.parse_requirements(r)).name)
|
||||
importlib.import_module(next(pkg.parse_requirements(rmin)).name)
|
||||
except ImportError:
|
||||
s += f'"{r}" '
|
||||
n += 1
|
||||
|
Reference in New Issue
Block a user