mirror of
https://github.com/esphome/esphome.git
synced 2024-11-25 08:28:12 +01:00
Edit error message for pillow install to add version restrictions (#5094)
This commit is contained in:
parent
9344d85414
commit
844cf316e2
1 changed files with 7 additions and 2 deletions
|
@ -67,13 +67,18 @@ def validate_pillow_installed(value):
|
|||
except ImportError as err:
|
||||
raise cv.Invalid(
|
||||
"Please install the pillow python package to use this feature. "
|
||||
"(pip install pillow)"
|
||||
'(pip install pillow">4.0.0,<10.0.0")'
|
||||
) from err
|
||||
|
||||
if version.parse(PIL.__version__) < version.parse("4.0.0"):
|
||||
raise cv.Invalid(
|
||||
"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
|
||||
|
|
Loading…
Reference in a new issue