Skip to content

Upgrading Python

Troy Prelog edited this page Jun 7, 2023 · 2 revisions

Upgrading Python for an existing plugin or jail requires manual intervention. On average, this will take at least 15-30 minutes to complete. However, a few users have reported waiting over an hour for the Home Assistant web UI to become available again! The amount of time it takes will vary depending on the speed of your NAS and the number of integrations you have added to Home Assistant.

Remember to take a snapshot of your jail before attempting to upgrade Python

  • replace JAIL_NAME with the name of your Home Assistant jail
  • replace SNAPSHOT_NAME with something meaningful to yourself
iocage snapshot JAIL_NAME -n SNAPSHOT_NAME

Install the new Python version, then reinstall the Home Assistant service (virtualenv)

iocage console JAIL_NAME
# Press 0 to exit the menu
pkg install python311 py311-sqlite3
sysrc homeassistant_python=/usr/local/bin/python3.11
service homeassistant reinstall homeassistant

If something goes wrong, you can revert to the snapshot you took before

iocage stop JAIL_NAME
iocage rollback JAIL_NAME -n SNAPSHOT_NAME