enviroplus-python icon indicating copy to clipboard operation
enviroplus-python copied to clipboard

Installing enviroplus-python library and running lcd.py does not work

Open gardiner opened this issue 1 year ago • 2 comments

After installing enviroplus-python library as described in the documentation the lcd.py example fails with an error 'int' object is not iterable'.

The reason is that the used ST7735 library has had a breaking change (see https://github.com/pimoroni/st7735-python/issues/32 for details).

Until the code in this repository is fixed you can solve the problem like this:

  • uninstall ST7735 library (e.g. pip uninstall st7735)
  • clone ST7735 repository (e.g. git clone https://github.com/pimoroni/st7735-python.git)
  • checkout commit before introducing breaking change (e.g. git checkout c0733d6)
  • install that version (e.g. pip install library/)

Note: If you are using a newer Pi OS using python virtual environments, you have to remember that su - and sudo do not respect a previously selected venv, so whenever you switch between the normal user and root, you have to make sure you activate the venv again.

gardiner avatar Nov 18 '23 10:11 gardiner

While the permanent fix is to update the examples in this repository, I just wanted to suggest a simpler workaround as noted here:

pip install st7735==0.0.5

This pins the st7735 library to the newest version prior to the breaking changes. Once the examples here are updated, you can just run pip install --upgrade st7735 and it should pull down the latest version again. There may be older versions available for any other similarly affected libraries, but I haven't personally checked.

Lipod avatar Nov 21 '23 13:11 Lipod

The updated examples are in an open pull request, you should use the library and examples from there until it's released/merged... probably something I should just do ASAP, but I'd hoped to get some feedback on it first -

See: https://github.com/pimoroni/enviroplus-python/pull/126

Gadgetoid avatar Nov 21 '23 13:11 Gadgetoid

Closing this one now that these changes are released/merged.

helgibbons avatar Apr 25 '24 14:04 helgibbons