See the section about Pillow
<https://github.com/weewx/weewx/wiki/pip-troubleshooting#pillow> in the
wiki page on Pip troubleshooting.

On Fri, Nov 8, 2024 at 10:21 PM '[email protected]' via weewx-user <
[email protected]> wrote:

> Hello,
>
> I've installed weewx the pip way in an ubuntu docker image. I'm getting
> the above error message when the ImageGenerator is run. I think there might
> be missing packages in the OS, but not really sure, and even if, which
> packages?
>
> Installed pip packages in the venv:
>
> ~$ pip list
> Package   Version
> --------- -----------
> configobj 5.0.9
> CT3       3.3.3.post1
> ephem     4.1.6
> paho-mqtt 2.1.0
> pillow    11.0.0
> pip       24.0
> PyMySQL   1.1.1
> pyserial  3.5
> pyusb     1.2.1
> six       1.16.0
> weewx     5.1.0
>
> A log from start to the first archive_interval (no debug set at this time,
> since I don't think it would provide additional benefit)
>
> 2024-11-09 06:52:02 weewxd[22970] INFO weewxd: Initializing weewxd version
> 5.1.0
> 2024-11-09 06:52:02 weewxd[22970] INFO weewxd: Command line:
> /home/michi/weewx-venv/bin/weewxd
> 2024-11-09 06:52:02 weewxd[22970] INFO weewxd: Using Python: 3.12.3 (main,
> Sep 11 2024, 14:17:37) [GCC 13.2.0]
> 2024-11-09 06:52:02 weewxd[22970] INFO weewxd: Located at:
> /home/michi/weewx-venv/bin/python3
> 2024-11-09 06:52:02 weewxd[22970] INFO weewxd: Platform:
> Linux-4.2.8-armv7l-with-glibc2.39
> 2024-11-09 06:52:02 weewxd[22970] INFO weewxd: Locale:       'C.UTF-8'
> 2024-11-09 06:52:02 weewxd[22970] INFO weewxd: Entry path:
> /home/michi/weewx-venv/bin/weewxd
> 2024-11-09 06:52:02 weewxd[22970] INFO weewxd: WEEWX_ROOT:
> /home/michi/weewx-data
> 2024-11-09 06:52:02 weewxd[22970] INFO weewxd: Config file:
>  /home/michi/weewx-data/weewx.conf
> 2024-11-09 06:52:02 weewxd[22970] INFO weewxd: User module:
>  /home/michi/weewx-data/bin/user
> 2024-11-09 06:52:02 weewxd[22970] INFO weewxd: Debug:        0
> 2024-11-09 06:52:02 weewxd[22970] INFO weewxd: User:         michi
> 2024-11-09 06:52:02 weewxd[22970] INFO weewxd: Group:        michi
> 2024-11-09 06:52:02 weewxd[22970] INFO weewxd: Groups:       sudo michi
> 2024-11-09 06:52:02 weewxd[22970] INFO weewx.engine: Loading station type
> GW1000 (user.gw1000)
> 2024-11-09 06:52:02 weewxd[22970] INFO user.gw1000: GatewayDriver: version
> is 0.6.3
> 2024-11-09 06:52:02 weewxd[22970] INFO user.gw1000:      device address is
> 10.0.1.85:45000
> 2024-11-09 06:52:02 weewxd[22970] INFO user.gw1000:      poll interval is
> 10 seconds
> 2024-11-09 06:52:02 weewxd[22970] INFO user.gw1000: GatewayService:
> version is 0.6.3
> 2024-11-09 06:52:02 weewxd[22970] INFO user.gw1000:      device address is
> 10.0.1.86:45000
> 2024-11-09 06:52:02 weewxd[22970] INFO user.gw1000:      poll interval is
> 10 seconds
> 2024-11-09 06:52:02 weewxd[22970] INFO user.MQTTSubscribe: (Service) Using
> paho.mqtt 2.1.0
> 2024-11-09 06:52:02 weewxd[22970] INFO user.MQTTSubscribe: (Service)
> Version is 3.0.0-rc10
> 2024-11-09 06:52:02 weewxd[22970] INFO user.MQTTSubscribe: (Service) Log
> level: 0
> 2024-11-09 06:52:02 weewxd[22970] INFO user.MQTTSubscribe: (Service) Log
> debug setting: 0
> 2024-11-09 06:52:02 weewxd[22970] INFO user.MQTTSubscribe: (Service) Log
> console: False
> 2024-11-09 06:52:02 weewxd[22970] INFO user.MQTTSubscribe: (Service) Log
> file: None
> 2024-11-09 06:52:02 weewxd[22970] INFO user.MQTTSubscribe: (Service) Not
> enabled, exiting.
> 2024-11-09 06:52:02 weewxd[22970] INFO weewx.engine: StdConvert target
> unit is 0x11
> 2024-11-09 06:52:02 weewxd[22970] INFO weewx.wxservices: StdWXCalculate
> will use data binding wx_binding
> 2024-11-09 06:52:02 weewxd[22970] INFO weewx.engine: Archive will use data
> binding wx_binding
> 2024-11-09 06:52:02 weewxd[22970] INFO weewx.engine: Record generation
> will be attempted in 'software'
> 2024-11-09 06:52:02 weewxd[22970] INFO weewx.engine: Using archive
> interval of 300 seconds (software record generation)
> 2024-11-09 06:52:02 weewxd[22970] INFO weewx.restx: StationRegistry:
> Registration not requested.
> 2024-11-09 06:52:02 weewxd[22970] INFO weewx.restx: Wunderground: Posting
> not enabled.
> 2024-11-09 06:52:02 weewxd[22970] INFO weewx.restx: PWSweather: Posting
> not enabled.
> 2024-11-09 06:52:02 weewxd[22970] INFO weewx.restx: CWOP: Posting not
> enabled.
> 2024-11-09 06:52:02 weewxd[22970] INFO weewx.restx: WOW: Posting not
> enabled.
> 2024-11-09 06:52:02 weewxd[22970] INFO weewx.restx: AWEKAS: Posting not
> enabled.
> 2024-11-09 06:52:02 weewxd[22970] INFO user.mqtt: service version is 0.24
> 2024-11-09 06:52:02 weewxd[22970] INFO user.mqtt: binding to loop
> 2024-11-09 06:52:02 weewxd[22970] INFO user.mqtt: data_binding is
> wx_binding
> 2024-11-09 06:52:02 weewxd[22970] INFO user.mqtt: topic is weather_test
> 2024-11-09 06:52:02 weewxd[22970] INFO user.mqtt: data will be uploaded to
> mqtt://10.0.1.90:1883/
> 2024-11-09 06:52:02 weewxd[22970] INFO weewx.engine: 'pyephem' detected,
> extended almanac data is available
> 2024-11-09 06:52:02 weewxd[22970] INFO weewxd: Starting up weewx version
> 5.1.0
> 2024-11-09 06:52:02 weewxd[22970] INFO weewx.engine: Using binding
> 'wx_binding' to database 'weewx.sdb'
> 2024-11-09 06:52:02 weewxd[22970] INFO weewx.manager: Starting backfill of
> daily summaries
> 2024-11-09 06:52:02 weewxd[22970] INFO weewx.manager: Daily summaries up
> to date
> 2024-11-09 06:52:02 weewxd[22970] INFO weewx.engine: Starting main packet
> loop.
> 2024-11-09 06:52:02 weewxd[22970] INFO user.gw1000: Using 't_rainyear' for
> rain total
> 2024-11-09 06:52:02 weewxd[22970] INFO user.gw1000: skipping rain
> measurement of 1922.3: no last rain
> 2024-11-09 06:52:02 weewxd[22970] INFO user.gw1000: Skipping lightning
> count of 0: no last count
> 2024-11-09 06:52:03 weewxd[22970] INFO user.gw1000: Using 't_rainyear' for
> rain total
> 2024-11-09 06:52:03 weewxd[22970] INFO user.gw1000: Using 'p_rainyear' for
> piezo rain total
> 2024-11-09 06:52:03 weewxd[22970] INFO user.gw1000: skipping rain
> measurement of 1922.3: no last rain
> 2024-11-09 06:52:03 weewxd[22970] INFO user.gw1000: skipping piezo rain
> measurement of 1952.0: no last rain
> 2024-11-09 06:52:03 weewxd[22970] INFO user.gw1000: Skipping lightning
> count of 0: no last count
> 2024-11-09 06:52:03 weewxd[22970] INFO user.mqtt: client established for
> mqtt://10.0.1.90:1883/
> 2024-11-09 06:55:16 weewxd[22970] INFO weewx.manager: Added record
> 2024-11-09 06:55:00 CET (1731131700) to database 'weewx.sdb'
> 2024-11-09 06:55:16 weewxd[22970] INFO weewx.manager: Added record
> 2024-11-09 06:55:00 CET (1731131700) to daily summary in 'weewx.sdb'
> 2024-11-09 06:55:16 weewxd[22970] INFO user.jsonengine: JSONGenerator:
> Generated 14 data items for Bootstrap-en in 0.10 seconds
> 2024-11-09 06:55:17 weewxd[22970] ERROR weewx.reportengine: Caught
> unrecoverable exception in generator 'weewx.imagegenerator.ImageGenerator'
> 2024-11-09 06:55:17 weewxd[22970] ERROR weewx.reportengine:         ****
>  cannot import name '_imagingft' from 'PIL'
> (/home/michi/weewx-venv/lib/python3.12/site-packages/PIL/__init__.py)
> 2024-11-09 06:55:17 weewxd[22970] ERROR weewx.reportengine:         ****
>  Traceback (most recent call last):
>
> 2024-11-09 06:55:17 weewxd[22970] ERROR weewx.reportengine:         ****
>  File
> "/home/michi/weewx-venv/lib/python3.12/site-packages/weewx/reportengine.py",
> line 248, in run
>
> 2024-11-09 06:55:17 weewxd[22970] ERROR weewx.reportengine:         ****
>    obj.start()
>
> 2024-11-09 06:55:17 weewxd[22970] ERROR weewx.reportengine:         ****
>  File
> "/home/michi/weewx-venv/lib/python3.12/site-packages/weewx/reportengine.py",
> line 465, in start
>
> 2024-11-09 06:55:17 weewxd[22970] ERROR weewx.reportengine:         ****
>    self.run()
>
> 2024-11-09 06:55:17 weewxd[22970] ERROR weewx.reportengine:         ****
>  File
> "/home/michi/weewx-venv/lib/python3.12/site-packages/weewx/imagegenerator.py",
> line 37, in run
>
> 2024-11-09 06:55:17 weewxd[22970] ERROR weewx.reportengine:         ****
>    self.gen_images(self.gen_ts)
>
> 2024-11-09 06:55:17 weewxd[22970] ERROR weewx.reportengine:         ****
>  File
> "/home/michi/weewx-venv/lib/python3.12/site-packages/weewx/imagegenerator.py",
> line 107, in gen_images
>
> 2024-11-09 06:55:17 weewxd[22970] ERROR weewx.reportengine:         ****
>    image = plot.render()
>
> 2024-11-09 06:55:17 weewxd[22970] ERROR weewx.reportengine:         ****
>            ^^^^^^^^^^^^^
>
> 2024-11-09 06:55:17 weewxd[22970] ERROR weewx.reportengine:         ****
>  File
> "/home/michi/weewx-venv/lib/python3.12/site-packages/weeplot/genplot.py",
> line 208, in render
>
> 2024-11-09 06:55:17 weewxd[22970] ERROR weewx.reportengine:         ****
>    self._renderBottom(draw)
>
> 2024-11-09 06:55:17 weewxd[22970] ERROR weewx.reportengine:         ****
>  File
> "/home/michi/weewx-venv/lib/python3.12/site-packages/weeplot/genplot.py",
> line 409, in _renderBottom
>
> 2024-11-09 06:55:17 weewxd[22970] ERROR weewx.reportengine:         ****
>    bottom_label_font =
> weeplot.utilities.get_font_handle(self.bottom_label_font_path,
>
> 2024-11-09 06:55:17 weewxd[22970] ERROR weewx.reportengine:         ****
>
>  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>
> 2024-11-09 06:55:17 weewxd[22970] ERROR weewx.reportengine:         ****
>  File
> "/home/michi/weewx-venv/lib/python3.12/site-packages/weeplot/utilities.py",
> line 585, in get_font_handle
>
> 2024-11-09 06:55:17 weewxd[22970] ERROR weewx.reportengine:         ****
>    font = ImageFont.truetype(fontpath_str,                         # See
> note 1
>
> 2024-11-09 06:55:17 weewxd[22970] ERROR weewx.reportengine:         ****
>
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>
> 2024-11-09 06:55:17 weewxd[22970] ERROR weewx.reportengine:         ****
>  File
> "/home/michi/weewx-venv/lib/python3.12/site-packages/PIL/ImageFont.py",
> line 879, in truetype
>
> 2024-11-09 06:55:17 weewxd[22970] ERROR weewx.reportengine:         ****
>    return freetype(font)
>
> 2024-11-09 06:55:17 weewxd[22970] ERROR weewx.reportengine:         ****
>           ^^^^^^^^^^^^^^
>
> 2024-11-09 06:55:17 weewxd[22970] ERROR weewx.reportengine:         ****
>  File
> "/home/michi/weewx-venv/lib/python3.12/site-packages/PIL/ImageFont.py",
> line 876, in freetype
>
> 2024-11-09 06:55:17 weewxd[22970] ERROR weewx.reportengine:         ****
>    return FreeTypeFont(font, size, index, encoding, layout_engine)
>
> 2024-11-09 06:55:17 weewxd[22970] ERROR weewx.reportengine:         ****
>           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>
> 2024-11-09 06:55:17 weewxd[22970] ERROR weewx.reportengine:         ****
>  File
> "/home/michi/weewx-venv/lib/python3.12/site-packages/PIL/ImageFont.py",
> line 227, in __init__
>
> 2024-11-09 06:55:17 weewxd[22970] ERROR weewx.reportengine:         ****
>    raise core.ex
>
> 2024-11-09 06:55:17 weewxd[22970] ERROR weewx.reportengine:         ****
>  File
> "/home/michi/weewx-venv/lib/python3.12/site-packages/PIL/ImageFont.py",
> line 66, in <module>
>
> 2024-11-09 06:55:17 weewxd[22970] ERROR weewx.reportengine:         ****
>    from . import _imagingft as core
>
> 2024-11-09 06:55:17 weewxd[22970] ERROR weewx.reportengine:         ****
>  ImportError: cannot import name '_imagingft' from 'PIL'
> (/home/michi/weewx-venv/lib/python3.12/site-packages/PIL/__init__.py). Did
> you mean: '_imaging'?
>
> 2024-11-09 06:55:17 weewxd[22970] ERROR weewx.reportengine:         ****
>  Generator terminated
>
> --
> You received this message because you are subscribed to the Google Groups
> "weewx-user" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion visit
> https://groups.google.com/d/msgid/weewx-user/60075587-d051-4997-815f-57f29774cb02n%40googlegroups.com
> <https://groups.google.com/d/msgid/weewx-user/60075587-d051-4997-815f-57f29774cb02n%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion visit 
https://groups.google.com/d/msgid/weewx-user/CAPq0zECZkQVaHFZXqRvxEL2W%2BHJsKn1CN0ZYDmG%3DSX91kwTD_w%40mail.gmail.com.

Reply via email to