wget https://www.python.org/ftp/python/3.9.7/Python-3.9.7.tgz
tar xzvf Python-3.9.7.tgz
cd Python-3.9.7
./configure
sudo make altinstall
sudo apt -y autoremove
cd
sudo rm -r Python-3.9.7
sudo rm Python-3.9.7.tgz
cd /srv
sudo mkdir homeassistant
sudo chown pi:pi homeassistant
sudo -u pi -H -s
cd /srv/homeassistant
/usr/local/bin/python3.9 -m venv .
source bin/activate
python3 -m pip install wheel
pip3 install homeassistant
问题出现在log如下
2021-09-21 15:30:56 ERROR (MainThread) [homeassistant.auth.providers] Unable to load auth provider homeassistant: libffi.so.7: cannot open shared object file: No such file or directory
2021-09-21 15:30:56 ERROR (MainThread) [homeassistant.bootstrap] Home Assistant core failed to initialize. Further initialization aborted
2021-09-21 15:30:56 WARNING (MainThread) [homeassistant.bootstrap] Unable to set up core integrations. Activating safe mode
2021-09-21 15:30:56 ERROR (MainThread) [homeassistant.auth.providers] Unable to load auth provider homeassistant: libffi.so.7: cannot open shared object file: No such file or directory
2021-09-21 15:30:56 ERROR (MainThread) [homeassistant.bootstrap] Home Assistant core failed to initialize. Further initialization aborted
2021-09-21 15:30:56 WARNING (SyncWorker_1) [homeassistant.bootstrap] Cannot launch the UI because frontend not loaded