gfx-hat
gfx-hat copied to clipboard
Examples fail to run with error "AttributeError: 'AsyncWorker' object has no attribute 'isAlive'"
After installing the code I get the following error:
Traceback (most recent call last):
File "/home/pi/Pimoroni/gfxhat/examples/hello-world.py", line 55, in
I've tried installing by running:
sudo pip3 install gfxhat
and
curl https://get.pimoroni.com/gfxhat | bash
and cloning the github repository and running:
sudo python3 setup.py install
I did a pip install first.
It appears the pip install installs Cap1xxx 0.1.3, pip show Cap1xxx gives me: Name: Cap1xxx Version: 0.1.3 Summary: A module to drive various Microchip cap1xxx touch ICs Home-page: http://shop.pimoroni.com Author: Philip Howard Author-email: [email protected] License: MIT Location: /usr/lib/python3/dist-packages Requires: RPi.GPIO Required-by: gfxhat, touchphat, pianohat, ExplorerHAT, drumhat
Running
sudo pip install Cap1xxx==0.1.4
got the example code to run.
Thank you. I thought I'd caught all of these but Graphics HAT slipped my mind.
Thanks aunitt! Your fix worked for me but took some finding. Seems like curl https://get.pimoroni.com/gfxhat | bash is unreliable.
@Gadgetoid - I've just recieved my gfxhat for a project and the install script still isn't working correctly - I had to manually install Cap1xxx 0.1.4 as mentioned by @aunitt above.
Another small issue, when running any of the examples you now get the following:
/home/user/hello-world.py:31: DeprecationWarning: getsize is deprecated and will be removed in Pillow 10 (2023-07-01). Use getbbox or getlength instead.
Change -
w, h = font.getsize(text)
x = (width - w) // 2
y = (height - h) // 2
To:
l, t, r, b = font.getbbox(text)
x = (width - r-l) // 2
y = (height - b) // 2