Edit error message for pillow install to add version restrictions (#5094)

This commit is contained in:
Jesse Hills 2023-07-13 09:38:24 +12:00 committed by GitHub
parent 9344d85414
commit 844cf316e2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -67,13 +67,18 @@ def validate_pillow_installed(value):
except ImportError as err: except ImportError as err:
raise cv.Invalid( raise cv.Invalid(
"Please install the pillow python package to use this feature. " "Please install the pillow python package to use this feature. "
"(pip install pillow)" '(pip install pillow">4.0.0,<10.0.0")'
) from err ) from err
if version.parse(PIL.__version__) < version.parse("4.0.0"): if version.parse(PIL.__version__) < version.parse("4.0.0"):
raise cv.Invalid( raise cv.Invalid(
"Please update your pillow installation to at least 4.0.x. " "Please update your pillow installation to at least 4.0.x. "
"(pip install -U pillow)" '(pip install pillow">4.0.0,<10.0.0")'
)
if version.parse(PIL.__version__) >= version.parse("10.0.0"):
raise cv.Invalid(
"Please downgrade your pillow installation to below 10.0.0. "
'(pip install pillow">4.0.0,<10.0.0")'
) )
return value return value