Hass won't launch on 1st install - RP3+ - cannot import contextfilter from Ninja

Hello, newbie here installing onto a working RP as per Home Assistant Core instructions (Raspberry Pi - Home Assistant). I have followed all the instructions and all seems well. However, when I try to start Hass, an error occurs and the launch is aborted

from jinja2 import contextfilter, contextfunction
ImportError: cannot import name ‘contextfilter’ from ‘jinja2’ (/srv/homeassistant/lib/python3.7/site-packages/jinja2/init.py)

Please advise how I should proceed. The Pi is currently successfully running Pihole and with the shortage I only have this board available.

Many thanks

2 Likes

The instructions said they required python 3.9, I wonder if that’s part of the difference?

1 Like

I have made progress with this issue. To aid others who may be experiencing issues such as this, I have progressed by:

  • Upgrade Python to 3.9.x . I used 3.9.1 (beware I still have issues, so maybe other versions will be better. Also note that the devs warn that a lot of these upgrades are not officially supported)
  • Following the upgrade of Python I had issues with the Sqlite3 version, so used the advice given by @CollinRobbins
    here. I also installed the libffi7 with instructions given by @torkis here.

The installation now launches, and I am able to access and configure it via browser. I have stability issues and I’m having trouble with the autostart, but I am hopeful I’ll find my way.

Thankyou for comments to this thread and to the those posting generous advice on the forums

1 Like