Hi, I am using ESPHome with Home Assistant, no problem. I have just added a display to my project and added font , display and i2c tot he YAML file. However, when running I get:
"Please install the pillow python package to use this feature. (pip install pillow).
file: font/monofont.ttf
id: opensans
size: 10"
The file does exist at the specified location.
I have added pillow, and can use it using python and python3:
>>> from PIL import Image
>>> im = Image.open("font/a.png")
>>> im.show()
It shows the image.
So the question is, what exactly is ESPHome looking for to satisfy itself that pillow is installed?
Installed ESPHome on a Win 10 machine, and my display is working just fine. Looks like this is specific to my mac setup. I will re-visit at some point.
I’m seeing the same behavior in the web based Studio Code Server. Projects that do not use a font or an image compile and OTA fine, project that do have fonts or images fail to compile with an error like this:
Failed config
font: [source esphome/blast-gate-01.yaml:46]
Please install the pillow python package to use this feature. (pip install pillow).
- file: gfonts://Roboto
id: roboto_20
size: 20
Please install the pillow python package to use this feature. (pip install pillow).
- file: gfonts://Roboto
id: roboto_24
size: 24
System details
Home Assistant 2023.2.2
Supervisor 2023.01.1
Operating System 9.5
Frontend 20230202.0 - latest
Add-on: Studio Code Server
Fully featured Visual Studio Code (VSCode) experience integrated in the Home Assistant frontend.
Add-on version: 5.5.2
You are running the latest version of this add-on.
System: Home Assistant OS 9.5 (amd64 / qemux86-64)
Home Assistant Core: 2023.1.7
Home Assistant Supervisor: 2023.01.1
Add-on: ESPHome
ESPHome add-on for intelligently managing all your ESP8266/ESP32 devices
Add-on version: 2022.12.8
You are running the latest version of this add-on.
System: Home Assistant OS 9.5 (amd64 / qemux86-64)
Home Assistant Core: 2023.2.2
Home Assistant Supervisor: 2023.01.1
I’m using the dashboard editor which is fine but VSCode would be better. I’d like to use my normal Windows install of VSCode w/ ESPhome extension but the same problem happens when I use Code Server, which I figured made for a better bug report as it’s bit more of a known and managed entity.
* Executing task: esphome run esphome/aq-sensor-02.yaml --device OTA
INFO Reading configuration esphome/aq-sensor-02.yaml...
WARNING GPIO4 is a Strapping PIN and should be avoided.
Attaching external pullup/down resistors to strapping pins can cause unexpected failures.
See https://esphome.io/guides/faq.html#why-am-i-getting-a-warning-about-strapping-pins
WARNING GPIO0 is a Strapping PIN and should be avoided.
Attaching external pullup/down resistors to strapping pins can cause unexpected failures.
See https://esphome.io/guides/faq.html#why-am-i-getting-a-warning-about-strapping-pins
Failed config
font: [source esphome/aq-sensor-02.yaml:554]
Please install the pillow python package to use this feature. (pip install pillow).
- file: gfonts://Roboto
id: font_roboto_16
size: 16
* The terminal process "/usr/bin/zsh '-c', 'esphome run esphome/aq-sensor-02.yaml --device OTA'" terminated with exit code: 2.
* Terminal will be reused by tasks, press any key to close it.
Wondering if maybe it needs to be in the Studio Code Server container I checked there to find pip3 is completely broken:
root@a0d7b954-vscode:/# pip3
Traceback (most recent call last):
File "/usr/local/bin/pip3", line 5, in <module>
from pip._internal.cli.main import main
File "/usr/local/lib/python3.9/dist-packages/pip/_internal/cli/main.py", line 9, in <module>
from pip._internal.cli.autocompletion import autocomplete
File "/usr/local/lib/python3.9/dist-packages/pip/_internal/cli/autocompletion.py", line 10, in <module>
from pip._internal.cli.main_parser import create_main_parser
File "/usr/local/lib/python3.9/dist-packages/pip/_internal/cli/main_parser.py", line 9, in <module>
from pip._internal.build_env import get_runnable_pip
File "/usr/local/lib/python3.9/dist-packages/pip/_internal/build_env.py", line 20, in <module>
from pip._internal.cli.spinners import open_spinner
File "/usr/local/lib/python3.9/dist-packages/pip/_internal/cli/spinners.py", line 9, in <module>
from pip._internal.utils.logging import get_indentation
File "/usr/local/lib/python3.9/dist-packages/pip/_internal/utils/logging.py", line 29, in <module>
from pip._internal.utils.misc import ensure_dir
File "/usr/local/lib/python3.9/dist-packages/pip/_internal/utils/misc.py", line 42, in <module>
from pip._internal.locations import get_major_minor_version
File "/usr/local/lib/python3.9/dist-packages/pip/_internal/locations/__init__.py", line 67, in <module>
from . import _distutils
File "/usr/local/lib/python3.9/dist-packages/pip/_internal/locations/_distutils.py", line 20, in <module>
from distutils.cmd import Command as DistutilsCommand
ModuleNotFoundError: No module named 'distutils.cmd'
Hi.
I am using ESPHome from commandline, made the manual install on my Mac and it worked.
Now if I try to compile a yaml, I get the error:
Please install the pillow python package to use this feature. (pip install "pillow==10.2.0").
and if I do this I get the following error
ry90@Macbook-Juergen epaper % pip install "pillow==10.2.0"
WARNING: Skipping /opt/homebrew/lib/python3.11/site-packages/pycparser-2.22.dist-info due to invalid metadata entry 'name'
WARNING: Skipping /opt/homebrew/lib/python3.11/site-packages/cryptography-42.0.8.dist-info due to invalid metadata entry 'name'
WARNING: Skipping /opt/homebrew/lib/python3.11/site-packages/pycparser-2.22.dist-info due to invalid metadata entry 'name'
WARNING: Skipping /opt/homebrew/lib/python3.11/site-packages/cryptography-42.0.8.dist-info due to invalid metadata entry 'name'
Requirement already satisfied: pillow==10.2.0 in /opt/homebrew/lib/python3.11/site-packages (10.2.0)
WARNING: Skipping /opt/homebrew/lib/python3.11/site-packages/pycparser-2.22.dist-info due to invalid metadata entry 'name'
WARNING: Skipping /opt/homebrew/lib/python3.11/site-packages/cryptography-42.0.8.dist-info due to invalid metadata entry 'name'
WARNING: Skipping /opt/homebrew/lib/python3.11/site-packages/pycparser-2.22.dist-info due to invalid metadata entry 'name'
WARNING: Skipping /opt/homebrew/lib/python3.11/site-packages/cryptography-42.0.8.dist-info due to invalid metadata entry 'name'
pip3 list|grep -i pillow
does not show anything. I feel like running in circles. Has anyone an idea what I could do?